When using tmux, I often do the following:
- Create a new window
- ssh to remote box
- cd to specific dir
- launch process
Now I want to tail the logfile of the process I just launched in a split. So I do the following:
- Split the window
sshto remote box (annoying)cdto specific dir (annoying)tail -f logs/run.log
What I wish was possible is to have a shortcut to split a window and automatically ssh to the same box and cd to the same dir as the parent window.
I came across the following command, which led me to believe it is possible:
bind-key S command-prompt -p ssh: "new-window -n %1 'ssh %1'"
Any idea how to achieve that?