Skip to content

Instantly share code, notes, and snippets.

@yunusemreayhan
Last active March 12, 2019 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yunusemreayhan/b19b773da269e4c758bdc981e76ff6f8 to your computer and use it in GitHub Desktop.
Save yunusemreayhan/b19b773da269e4c758bdc981e76ff6f8 to your computer and use it in GitHub Desktop.
tmux conf one session multiple windows
#!/bin/bash
tmux start-server
dev_session_name="dev"
tmux has-session -t $dev_session_name
if (( $? )) ; then
tmux new-session -d -s ${dev_session_name} -n src
tmux send-keys "ses 0 command" C-m
tmux new-window -t ${dev_session_name}:1 -n sblock
tmux send-keys "ses 1 command" C-m
tmux new-window -t ${dev_session_name}:2 -n shal
tmux send-keys "ses 2 command" C-m
else
echo "dev session already exist"
fi
tmux attach-session -t ${dev_session_name}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment