camgraff / telescope-tmux.nvim

Integration for tmux with telescope.nvim
123 stars 5 forks source link

Display popup not work #13

Open loeffel-io opened 1 month ago

loeffel-io commented 1 month ago

Hey, can't open the display popup correctly. Is there anything i am doing wrong? Thank you

# lazy
return {
    "camgraff/telescope-tmux.nvim",
}
# Set 256 color terminal
set -g default-terminal "screen-256color"

# Pane splitting
unbind %
unbind '"'
bind-key | split-window -h
bind-key - split-window -v

# Pane resizing
bind-key -r j resize-pane -D 5
bind-key -r k resize-pane -U 5
bind-key -r l resize-pane -R 5
bind-key -r h resize-pane -L 5
bind-key -r m resize-pane -Z

# Pane navigation
bind-key -r C-h select-pane -L
bind-key -r C-j select-pane -D
bind-key -r C-k select-pane -U
bind-key -r C-l select-pane -R

# Enable mouse
set-option -g mouse on

# Use vi key bindings in copy mode
set-window-option -g mode-keys vi

# Copy mode bindings
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-selection
bind-key -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel 'pbcopy'
unbind -T copy-mode-vi MouseDragEnd1Pane

# fix open 
set-option -g default-command "reattach-to-user-namespace -l zsh"

# Performance optimizations
set-option -sg escape-time 10
set-option -g focus-events off

# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'

# Plugin configurations
set -g @continuum-restore 'on'
set -g @resurrect-capture-pane-contents 'on'

# use telescope-tmux for picking sessions and windows 
bind s display-popup -E -w 80% -h 80% nvim -c ":Telescope tmux sessions quit_on_select=true"
bind w display-popup -E -w 80% -h 80% nvim -c ":Telescope tmux windows quit_on_select=true"

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

"s" opens this:

Bildschirmfoto 2024-09-17 um 12 19 56
loeffel-io commented 1 month ago

works correctly inside nvim

Dissonant-Tech commented 1 month ago

Just ran into this issue as well, fix for me was changing the neovim arguments form --cmd to +:

bind s display-popup -E -w 80% -h 80% nvim +":Telescope tmux sessions quit_on_select=true"

In my case I was also using auto-session and those arguments changed as well from + to --cmd in this case:

bind s display-popup -E -w 100% -h 100% nvim --cmd "let g:auto_session_enabled = v:false" +":Telescope tmux sessions quit_on_select=true"