Open Zerophase opened 2 years ago
Same here
same here. It moves between tmux panes. It also moves from tmux pane to neovim pane and visa versa. But it doesn't move between neovim panes itself.
Hey folks, could you run through the troubleshooting list, notably the TmuxNavigatorProcessList
bit? I'm wondering if something may be up with neovim in recent versions (see https://github.com/christoomey/vim-tmux-navigator/issues/324 for a potentially related issue).
:TmuxNavigatorProcessList
is not an option in my neovim setup.
Hmm, are you perhaps on a very old version of the vim plugin? :TmuxNavigatorProcessList
was added in mid 2018, so possible you're version predates that @azinsharaf?
I doubt it since i installed it recently. How can I check its version?
Definitely odd then. Can you try running :TmuxNavigatorProcessList
directly? Your screenshot is showing tab completion and I'm wondering if the prefix :TmuxNavigate...
vs TmuxNavigator...
being different might explain why you're not seeing it.
Alternatively you could track down where your vim plugins are installed and look at the contents of the file itself to see if it matches what's on github right now.
:TmuxNavigatorProcessList
is not an editor command.
I am wondering how it works for @Zerophase and @dattran1232003.
@christoomey i am using Neovim v0.8.0. Does the plugin support neovim?
The plugin is definitely intended to support Neovim. I'm surprised to see that it's not working. Can you track down the installed version of the plugin on your machine and confirm if it matches the version on Github? Specifically this line is the one that defines the command in question.
I re-installed it and have the same issue. Confirming that i am using the latest version. This is a gif file about how it looks like:
Yup, I can definitely see what you're reporting. Unfortunately not much more for me to go from in the gif.
Can you track down the installed version of the plugin code on your machine and confirm if it matches the version on Github? Specifically this line is the one that defines the command in question.
Exact same issue here.
TmuxNavigatorProcessList
gives: Ss+ /bin/zsh (figterm)
Probably same issue a https://github.com/christoomey/vim-tmux-navigator/issues/295 ?
Copy-Paste fix that works for me:
In .tmux.conf
, replace is_vim
with:
is_vim="children=(); i=0; pids=( $(ps -o pid= -t '#{pane_tty}') ); \
while read -r c p; do [[ -n c && c -ne p && p -ne 0 ]] && children[p]+=\" $\{c\}\"; done <<< \"$(ps -Ao pid=,ppid=)\"; \
while (( $\{#pids[@]\} > i )); do pid=$\{pids[i++]\}; pids+=( $\{children[pid]-\} ); done; \
ps -o state=,comm= -p \"$\{pids[@]\}\" | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
ps: this works, but seems to have some impact on performance
Exact same issue here.
TmuxNavigatorProcessList
gives:Ss+ /bin/zsh (figterm)
I had the same issue but in my case, it was caused by https://fig.io/. I uninstalled it and now it's working as expected.
I fixed the issue using this tip
Added lines in .tmux.conf
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
didn't work for me. Interested to see how it works for others.
Are you running a poetry shell by any chance? I see the same problem (navigating inside Neovim doesn't work, but does between Neovim and tmux) but only if I've run poetry shell
before starting Neovim.
FWIW, the output of :TmuxNavigatorProcessList
with a poetry shell running:
Ss -zsh
S -zsh
S /Users/johno/.cache/gitstatus/gitstatusd-darwin-arm64
S+ /opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/Resources/Python.app/Contents/MacOS/Python
and without poetry shell running:
Last login: Fri Nov 25 22:42:57 on ttys000
Ss -zsh
S -zsh
S /Users/johno/.cache/gitstatus/gitstatusd-darwin-arm64
S+ nvim
I can confirm I used it for a while without any problem. As soon as I run poetry shell
, I can't switch inside neovim anymore, only between tmux windows. I can create a new window again and without poetry, it works again.
TmuxNavigatorProcessList
when it does not work any longer :(
Ss -zsh
S -zsh
S -zsh
S -zsh
S /Users/sspaeti/.cache/gitstatus/gitstatusd-darwin-arm64
S+ /opt/homebrew/Cellar/python@3.11/3.11.0/Frameworks/Python.framework/Versions/3.11/Resources/Python.app/Contents/MacOS/Python
Anything I can workaround this?
Found the same error mentioned in https://github.com/christoomey/vim-tmux-navigator/issues/230#issuecomment-1317678653. The workaround seems to much for me though, but also didn't work. I'm using Python with venvs
all the time without problems, I'm not sure why poetry behaves differently here.
In my case, it looks like I've got $SHELL
pointing at the OS-default zsh (/bin/zsh
) which isn't the zsh I'm actually using (Homebrew-installed, /opt/homebrew/bin/zsh
). Here's some heavily trimmed output showing my normal zsh (top half) and the zsh run by poetry (bottom half):
❯ ps
PID TTY TIME CMD
...
1154 ttys000 0:00.01 tmux -f /Users/johno/.tmux.conf attach
1372 ttys001 0:21.85 -zsh
...
87818 ttys007 0:00.47 /bin/zsh -i
Setting $SHELL to either just zsh
on its own, or the full path to the Homebrew zsh seems to have resolved this, though I've only tested this for 10 minutes or so.
@johnoshea Wow, that is a big one; thanks for that, I never noticed this! It did not work for me :( But I added the export SHELL=zsh
to my .zshrc
anyway, as I guess that should be more correct, although I hadn't had any problem otherwise.
My workaround, for now, is that I have alternative moving shortcuts for vim that I can use in case I bump into that problem with:
"Move window
noremap sh <C-w>h
noremap sk <C-w>k
noremap sj <C-w>j
noremap sl <C-w>l
Exact same issue here.
TmuxNavigatorProcessList
gives:Ss+ /bin/zsh (figterm)
I had the same issue but in my case, it was caused by https://fig.io/. I uninstalled it and now it's working as expected.
I had the same problem with https://fig.io/ and uninstalling fig worked for me too. I guess this issue is worth searching for a solution, because I neither want to dispense with fig nor the vim-tmux-navigation... I will open up an issue on that one
I feel like @Zerophase 's issue is different to all the subsequent replies, and it's their issue I'm currently facing. Though after looking into both the vim plugin and the tmux binding implementations, I believe what Zerophase and I both want to happen simply isn't part of tmux-vim-navigator's intended behaviour.
When switching from a tmux pane without vim into a tmux pane with vim (i.e. a tmux-vim-pane), if the tmux-vim-pane has multiple vim panes itself, I'd like to switch into the closest of those vim-panes (if this is confusingly described, Zerophase's original comment already gives a simple case example).
So far as I understand, it is the intended behaviour that: when switching into a tmux-vim-pane, the vim-pane that will be selected will be whichever one was last active when this tmux-vim-pane was last active. And therefore not necessarily the vim-pane adjacent to the tmux-pane I just left.
If this is true, please confirm and perhaps update the readme to reflect this.
Just reporting that poetry shell
is causing problems for me as well. When I have nvim tree on the very left and some code next to it, with a vertical split, keybindings to move between tmux and nvim will only work in one of the following ways:
1/ if I were focused on nvim-tree, then keybinding will take me to tmux. Then again to nvim-tree 2/ if I were focused on code, then keybinding will take me to tmux. Then again to code
The above happens if poetry shell
before starting nvim.
If I do not poetry shell
, I can move correctly from nvim-tree to code to tmux and back.
Curious fact, if executing :TmuxNavigateLeft
directly (or another navigation command), it all works well.
Just reporting that
poetry shell
is causing problems for me as well. When I have nvim tree on the very left and some code next to it, with a vertical split, keybindings to move between tmux and nvim will only work in one of the following ways:1/ if I were focused on nvim-tree, then keybinding will take me to tmux. Then again to nvim-tree 2/ if I were focused on code, then keybinding will take me to tmux. Then again to code
The above happens if
poetry shell
before starting nvim.If I do not
poetry shell
, I can move correctly from nvim-tree to code to tmux and back.Curious fact, if executing
:TmuxNavigateLeft
directly (or another navigation command), it all works well.
https://github.com/christoomey/vim-tmux-navigator/issues/230#issuecomment-776097681
poetry run nvim
seems to fix this issue
I also start to feel like @Zerophase's original issue isn't being addressed here anymore. I'm curious if there is going effort in trying to add the original feature (if possible at all). I also feel like, whether it is possible to or not, that the issue at hand should be addressed somewhere. Possibly in the vim-tmux-navigator README.
I would love @christoomey's thoughts on the original issue as well.
I have the same issue when running vim from poetry
same here on mac m3
How to reproduce.
You'll switch to the last active vim split, instead of wrapping around to the split furthest to the right.