Last active
December 2, 2022 19:18
-
-
Save bobbzorzen/ab7e5492ddbdcaa6298a7cb0db776886 to your computer and use it in GitHub Desktop.
Basic script for starting a tmux session with specific windows and execute code in them
This file contains 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 -n "Name of window 1" -s "dev" -c "/home/<User>/workspace" -d '<command to run e.g. nano file.txt>' | |
tmux new-window -n "Name of Window 2" -c "/home/<User>/workspace" '<command to run e.g. nano file.txt>' | |
tmux next-window # Selects the next window, since we're currently selecting the last window, the next window is the first window | |
tmux -2 a # now we attach to the newly created session using 256 color mode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment