Last active
December 29, 2021 07:02
-
-
Save milisarge/ede7cef488a3b505e14e95dd30c4ecd2 to your computer and use it in GitHub Desktop.
Tmux shells from script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| tmux new-session -d -s work1 'cd a/b/c'; # start new detached tmux session, run htop | |
| tmux split-window; # split the detached tmux session | |
| tmux send 'cd /d/e/f' ENTER; # send 2nd command 'htop -t' to 2nd pane. I believe there's a `--target` option to target specific pane. | |
| #tmux a; | |
| tmux new-session -d -s work2 'htop'; | |
| # default vertical / -h horizontal | |
| tmux split-window -h; | |
| tmux send 'a/b/c/myscript.sh' ENTER; | |
| tmux a; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment