yudai / sshh

A SSH session duplicator for tmux
Apache License 2.0
80 stars 10 forks source link

FYI this can be simplified tremendously #7

Open pschmitt opened 4 years ago

pschmitt commented 4 years ago

With more recent versions of TMUX you can make use of split-window which accepts a command.

Here's what I have right now which provides the same functionality as sshh:

https://gist.github.com/pschmitt/293a9895abe14399b0d8a20cf68dd25c

TLDR: The config part is way tidyer:

bind S run "$TMUX_BIN_HOME/tmux-split-ssh.sh -c #{pane_current_path} -v"
bind | run "$TMUX_BIN_HOME/tmux-split-ssh.sh -c #{pane_current_path} -h"
pschmitt commented 4 years ago

I made a TPM plugin for this: https://github.com/pschmitt/tmux-split-ssh