Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update is_vim detection logic for tmux 3.2 #300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

christoomey
Copy link
Owner

Users upgrading to tmux 3.2 have been reporting issues with using the
plugin, specifically that it would "freeze" their terminal for 30+
seconds.

@kidonchu kindly provided an updated version of the is_vim check that
seems to resolve the issue, so this PR updates the README and TPM script
to use that version.

Users upgrading to tmux 3.2 have been reporting issues with using the
plugin, specifically that it would "freeze" their terminal for 30+
seconds.

@kidonchu kindly provided an updated version of the `is_vim` check that
seems to resolve the issue, so this PR updates the README and TPM script
to use that version.
Copy link

@dkarter dkarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you for the fix! Tested with tmux next-3.3 and Neovim 0.5.

@christoomey
Copy link
Owner Author

@dkarter thanks for the note! I'm also looking to confirm if this version of the snippet is reasonably backwards compatible, so hoping to hear from folks on tmux < 3.2 to validate that, so will likely need to keep this open for a bit.

@mhartington
Copy link

mhartington commented Oct 4, 2021

👋 Hello! So I gave this a shot on my setup with tmux 3.2, but I think the issue is still there.

  is_vim="ps -o state=,tty=,comm= | grep -iqE '^[^TXZ ]+ +#{s|/dev/||:pane_tty}\s+(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
  bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
  bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
  bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
  bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"

With this plus the typical vim keybindings, it seems to skip over vim splits and goes directly to changing tmux panes.

EDIT: Turns out fig was causing some issue where it modified the results from TmuxNavigatorProcessList. Uninstalled and everything worked fine.

@unphased
Copy link

unphased commented Oct 10, 2021

Hi could you clarify what fig is? never mind.

@yut23
Copy link

yut23 commented Oct 15, 2021

This doesn't work for me on Fedora 34 (using ps from procps-ng 3.3.17), but passing -a to ps fixes it. Without that, it seems to just list all the processes with no connected terminal.

@sullivan-sean
Copy link

sullivan-sean commented Nov 29, 2021

👋 Hello! So I gave this a shot on my setup with tmux 3.2, but I think the issue is still there.

  is_vim="ps -o state=,tty=,comm= | grep -iqE '^[^TXZ ]+ +#{s|/dev/||:pane_tty}\s+(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
  bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
  bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
  bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
  bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"

With this plus the typical vim keybindings, it seems to skip over vim splits and goes directly to changing tmux panes.

EDIT: Turns out fig was causing some issue where it modified the results from TmuxNavigatorProcessList. Uninstalled and everything worked fine.

I think this approach #295 (comment) should fix incompatibility with Fig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants