Skip to content

Commit 18b775f

Browse files
committed
TmuxPaneCurrentCommand -> TmuxNavigatorProcessList
Previously we used the `{pane_current_command}` tmux variable and matched against that, but a while back we switched to using the process list to better handle some edge cases. Overall that change has been a win, but the documentation has lagged a bit around the debugging command `:TmuxPaneCurrentCommand` which is no longer relevant. This change replaces `:TmuxPaneCurrentCommand` with a new `:TmuxNavigatorProcessList` which should allow us to debug the actual issue related to the `ps` command.
1 parent d030f75 commit 18b775f

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

README.md

+15-5
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ Left would be created with `nnoremap <silent> <c-h> :TmuxNavigateLeft<cr>`.
116116

117117
##### Autosave on leave
118118

119-
You can configure the plugin to write the current buffer, or all buffers, when navigating from Vim to tmux. This functionality is exposed via the `g:tmux_navigator_save_on_switch` variable, which can have either of the following values:
119+
You can configure the plugin to write the current buffer, or all buffers, when
120+
navigating from Vim to tmux. This functionality is exposed via the
121+
`g:tmux_navigator_save_on_switch` variable, which can have either of the
122+
following values:
120123

121124
Value | Behavior
122125
------ | ------
@@ -211,10 +214,17 @@ altered to avoid conflicting with the mappings from the plugin.
211214

212215
Another option is that the pattern matching included in the `.tmux.conf` is
213216
not recognizing that Vim is active. To check that tmux is properly recognizing
214-
Vim, use the provided Vim command `:TmuxPaneCurrentCommand`. The output of
215-
that command should be a string like 'vim', 'Vim', 'vimdiff', etc. If you
216-
encounter a different output please [open an issue][] with as much info about
217-
your OS, Vim version, and tmux version as possible.
217+
Vim, use the provided Vim command `:TmuxNavigatorProcessList`. The output of
218+
that command should be a list like:
219+
220+
```
221+
Ss -zsh
222+
S+ vim
223+
S+ tmux
224+
```
225+
226+
If you encounter a different output please [open an issue][] with as much info
227+
about your OS, Vim version, and tmux version as possible.
218228

219229
[open an issue]: https://github.com/christoomey/vim-tmux-navigator/issues/new
220230

plugin/tmux_navigator.vim

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ function! s:TmuxCommand(args)
6464
return system(cmd)
6565
endfunction
6666

67-
function! s:TmuxPaneCurrentCommand()
68-
echo s:TmuxCommand("display-message -p '#{pane_current_command}'")
67+
function! s:TmuxNavigatorProcessList()
68+
echo s:TmuxCommand("run-shell 'ps -o state= -o comm= -t ''''#{pane_tty}'''''")
6969
endfunction
70-
command! TmuxPaneCurrentCommand call s:TmuxPaneCurrentCommand()
70+
command! TmuxNavigatorProcessList call s:TmuxNavigatorProcessList()
7171

7272
let s:tmux_is_last_pane = 0
7373
augroup tmux_navigator

0 commit comments

Comments
 (0)