preservim / vimux

easily interact with tmux from vim
MIT License
2.21k stars 161 forks source link

Failed to find executable tmux #194

Closed ogmueller closed 3 years ago

ogmueller commented 3 years ago

When using the plugin on macos 11.2.3 (20D91) with Terminal or iTerm, it will throw an error:

$ vi test
Failed to find executable tmux
alerque commented 3 years ago

Is tmux in your $PATH?

$ which tmux

You realize this should typically be used by starting VIM inside a TMUX session and the plugin will just add a new pane to run jobs in right?

ogmueller commented 3 years ago

It seems not to be in PATH

$ which tmux
tmux not found

Somehow strange. I haven't changed my .vimrc for a long time and never had this error. Maybe an update to macos BigSur or iTerm2 changed something. Or brew removed it with other dependencies.

Doing a brew install tmux fixed it. Thnx.

gpakosz commented 3 years ago

I'm hitting this on a computer that doesn't have tmux installed and I don't want to install it there.

Could vimux just skip its initialization when tmux is not present? This would help sharing my Vim configuration with different computers.

alerque commented 3 years ago

@gpakosz I'm not sure about "just skip", but I think downgrading this from a hard error that blocks vim startup to a warning that you can move on from would be fine. I'd be happy to accept a PR to that affect.

gpakosz commented 3 years ago

Not interested if it's a warning 🙂

I'll just work around it by doing

if !executable('tmux')
  let g:loaded_vimux = 1
endif

from plugins/settings/vimux.vim

alerque commented 3 years ago

I think a warning is better than an error and would like to see that happen even if it doesn't help your use case. As for default behavior I think the warning will be more broadly useful that a silent failure. The number of people that expect this to work when they install it and yet have issues with it finding tmux (as was the original report in this issue!) is almost certainly higher than those installing the plugin and deliberately not expecting it to work (as in your comment).

Your workaround sounds appropriate for your desired outcome.

anthonybrown commented 2 years ago

I'm having the same problem, failed to find executable tmux. Going to try brew install tmux and see if that fixes it.