How can I tell what command is running on the remote end of an ssh connection?
- by user268385
Tl;dr - how do I find the name of the command (eg $BASH_COMMAND) running on the remote end of an ssh connection?
...
My example setup is two tmux vertical panes,
LH pane runs a local vim session with vertical split,
RH pane runs an ssh session running vim, again with a vertical split.
Using tmux-navigator I can navigate from left to right over the first 3 vim buffers, but the 4th (far right hand one) is inaccessible.
The reason for this is that tmux-navigator tests the value of 'pane_current_command' and compares it to 'vim' before deciding which keystrokes to dispatch. On the right hand tmux pane, the current command is 'ssh' and not 'vim'.
What I want to do is test for (pane_current_command =~ 'ssh'), and if so, examine the command that is running on the far side of the connection? I cannot find a way to get hold of this, so any suggestions would be welcome?
For information, the problem is almost the same as this one, but without the nested tmux sessions:
https://github.com/christoomey/vim-tmux-navigator/issues/12