christoomey / vim-tmux-navigator

Seamless navigation between tmux panes and vim splits
MIT License
5.07k stars 319 forks source link

Problems when using vim-tmux-navigator with fig (https://fig.io) #339

Closed juliangoetze closed 11 months ago

juliangoetze commented 1 year ago

Vim-Tmux Problems when using fig

As mentioned here, there are problems when using vim-tmux-navigator together with fig.

My observations:

capture

Possible problem sources:

#.zshrc
# Fig pre block. Keep at the top of this file.
[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] $$ builtin source "$HOME/.fig/shell/zshrc.pre.zsh"

# My zsh configs
# ...

# Fig post block. Keep at the bottom of this file.
[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] $$ builtin source "$HOME/.fig/shell/zshrc.post.zsh"
# ~/.fig/shell/zshrc.pre.zsh
# (sourced in the .zshrc)
[ -x ~/.local/bin/fig ] && eval "$(~/.local/bin/fig init zsh pre --rcfile zshrc)"
# ~/.fig/shell/zshrc.post.zsh
# (sourced in the .zshrc)
[ -x ~/.local/bin/fig ] && eval "$(~/.local/bin/fig init zsh post --rcfile zshrc)"

The setup:

If anyone has a solution in mind, please tell me about it :) If not, I'll just say goodbye to fig, that's fine to me...

And if more information is needed, just hit me up and I'll paste it here.

vhristev commented 1 year ago

After uninstalling Fig everything started to work again.

brew uninstall fig
juliangoetze commented 1 year ago

After uninstalling Fig everything started to work again.

brew uninstall fig

@vhristev Yes, that solved the problem for me too. The question is, if there is any solution/ workaround to have fig and the tmux-navigator working at the same time, without having to dispense with one of both..

JakeTompkins commented 1 year ago

I'm having the same problem. I'd like to keep using fig so a solution to this would be awesome. Let me know if I can provide any other diagnostics to help troubleshoot

nguyenanhhao221 commented 1 year ago

I'm having the same issue. Removing fig work fine.

But does anybody know a similar solution to fig. I'm not that familiar with all the terminal command so fig tool can really help with it cause they also include a explanation

unitythemaker commented 1 year ago

I have the same problem but I don't have Fig installed. I use NixOS if that makes any change but I am so annoyed by how it works perfect on everyone else and doesn't work on my pc...

unitythemaker commented 1 year ago

I have the same problem but I don't have Fig installed. I use NixOS if that makes any change but I am so annoyed by how it works perfect on everyone else and doesn't work on my pc...

Seems like the issue was that I am using Fish. When I set my default shell to bash, it worked even if the default shell set in the tmux was fish. When I did it with fish I was getting no output from :TmuxNavigatorProcessList when I switched to bash I got the output:

S fish
S nvim

Btw it also did not work when I tried to spawn an instance of bash in fish.

Perhaps, I should open an issue for this? For me, I will use tmux as default (by making bash execute tmux) so it is not a problem for me but could be a problem for others and maybe it should be noted on readme.

hoolek77 commented 1 year ago

If you still encounter this issue, this solution helped me to fix integration with Fig https://github.com/christoomey/vim-tmux-navigator/issues/295#issuecomment-922092511

juliangoetze commented 11 months ago

As @hoolek77 mentioned, the solution of #295 fixes this issue (mostly). After creating the is_vim.sh as suggested, and replacing the is_vim line in the tmux plugin, the horizontal pane switching does work, although vertical window switching in vim itself does still not work as expected. I will close this issue as fixed with the workaround of #295 .