Last active
March 21, 2020 01:12
-
-
Save mihaiparaschiv/7a970a51ea481696368e81f36e6646b9 to your computer and use it in GitHub Desktop.
Utility scripts to create a tmux session
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
tmux new-window -n analysis -c /d/work/example | |
cd /g/work/a-analytics | |
tmux select-window -t analysis | |
tmux split-window -v -p 80 | |
tmux select-pane -t 0 | |
tmux send-keys "cd run/analysis-local" C-m | |
tmux send-keys "ls -la" C-m | |
tmux select-pane -t 1 | |
tmux send-keys "ls -la" C-m | |
tmux split-window -h | |
tmux select-pane -t 0 | |
tmux select-window -t analysis | |
tmux kill-window -t 0 |
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
set -e | |
TMUX_SESSION="$1" | |
if tmux list-sessions | grep -q ${TMUX_SESSION}; then | |
echo "${TMUX_SESSION} session already running" | |
tmux attach-session -t ${TMUX_SESSION} | |
else | |
tmux new -d -s ${TMUX_SESSION} -c /d/work | |
tmux send-keys -t ${TMUX_SESSION} "source setup-tmux-${TMUX_SESSION}.sh" C-m | |
tmux attach-session -t ${TMUX_SESSION} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment