christoomey / vim-tmux-navigator

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

Debugging vim-tmux-navigator in an Alpine docker #340

Closed mihaigalos closed 1 year ago

mihaigalos commented 1 year ago

Thanks for this awesome plugin!

I'm trying to use it in an Alpine docker. Pressing C-x, C-l in insert mode should bring up the insert line autocompletion. It doesn't work (vim displays -- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y) at the bottom of the screen).

I noticed the ps command executed by is_vim is a bit different:

- vim-tmux-navigator.tmux:is_vim="ps -o state= -o comm= -t '#{pane_tty}'
+ vim-tmux-navigator.tmux:is_vim="ps -o stat= -o comm= -t '#{pane_tty}'

What else am I missing? How can I best debug the plugin?

mihaigalos commented 1 year ago

Up: Seems I was on the right track. On Alpine, ps has the -T flag. So the diff becomes:

- vim-tmux-navigator.tmux:is_vim="ps -o state= -o comm= -t '#{pane_tty}'
+ vim-tmux-navigator.tmux:is_vim="ps -o stat= -o comm= -T '#{pane_tty}'

I would like to help with a PR where the /etc/os-release is evaluated and based on that, the ps command is constructed. Do you think it would make sense?

mihaigalos commented 1 year ago

The -T has a different meaning with the ps command on Alpine (symlink to busybox). So instead of using the default Alpine ps, the easiest solution here is to just install the "full" ps:

$ apk update && apk add procps

I'm closing this now.