-
Notifications
You must be signed in to change notification settings - Fork 334
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
C-\ not working to switch panes in tmux #298
Comments
Hey @noahmoss, not sure what the issue is, but I've got some questions that might help debug:
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
- "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
+ "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'display-panes'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
- "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
+ "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'display-panes'" This'll swap out the pane switching for the |
Hi @christoomey, thanks for the debugging tips! I'm on tmux 3.2
Changing the commands still doesn't work. I guess that means the key binding itself isn't working? This might be a case of some other config messing with things... |
I also have vi-mode enabled in bash, which I realized was the root cause of #297. But I tried disabling it and I still wasn't able to get |
One other thing worth checking is the output of Based on your testing, it sounds like you're in the murky world of bind-key -n 'C-\\' if-shell "$is_vim" 'send-keys C-\\\\' 'select-pane -l' Hopefully you can work from that (might have to tweak some |
I had the same problem and this fixed it for me. Escaping bind-key -n C-\\ if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l' |
I have the same problem. Looks like it is
Hence Not sure if one of the below could cause the problem.
|
Was able to fix this with
|
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'"
bind-key -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
bind-key -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
bind-key -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
bind-key -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
if-shell '[ $(echo $(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p") "<" 3 | bc) -eq 1 ]' \
"bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\' 'select-pane -l'"
if-shell '[ $(echo $(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p") ">=" 3 | bc) -eq 1 ]' \
"bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\\\' 'select-pane -l'" These variables confuse me, maybe writing shell script directly is more intuitive |
This line is storing the expression rather than the version value.
Using
|
This is the issue I mentioned in #297.
Basically,
C-\
is working to switch to the last pane when I'm in vim, but when I'm in a bash pane it doesn't do anything at all. Nothing is even printed or displayed. My.tmux.conf
is set up with the exact commands in the readme. Also tried it in zsh and it exhibits the same behavior.Thanks for any help you can provide! :)
The text was updated successfully, but these errors were encountered: