SESSION_NAME='mysession'
tmux new -s "${SESSION_NAME}"
This particular example will run SimpleHTTPServer in the background:
SESSION_NAME='python_sesh'
tmux new -s "${SESSION_NAME}" -d 'python3 -m http.server'
kill -9 "$(top -n 1 | pgrep tmux)"
SESSION_NAME='mysession'
tmux a -t "${SESSION_NAME}"
# Alternatively:
tmux attach -t "${SESSION_NAME}"
# Outside of a tmux session:
tmux ls
# Within a tmux session:
Ctrl b s
SESSION_NAME='ohno'
tmux kill-session -t "${SESSION_NAME}"
Resources: https://gist.github.com/henrik/1967800
Great tutorial here: https://collectiveidea.com/blog/archives/2017/03/27/using-tmuxinator-to-automate-your-environment
In iTerm2:
Use Ctrl c to copy and Ctrl v to paste.
If on a mac:
This particular example will show the help menu for
Ctrl b t, which will display the current time:

Type this command in:
At this point you can use your arrow keys, page up/page down, etc.
Resource: https://superuser.com/questions/209437/how-do-i-scroll-in-tmux
Horizontal split:
Vertical split:
Change direction of split:
Resources: https://gist.github.com/MohamedAlaa/2961058
SESSION_NAME='mysession'
NEW_START_DIR='/home/ubuntu/somewhere'
tmux attach-session -t "${SESSION_NAME}" -c "${NEW_START_DIR}"
Resource: https://stackoverflow.com/questions/27307815/how-to-change-the-starting-directory-of-a-tmux-session
Resource: https://superuser.com/questions/249659/how-to-detach-a-tmux-session-that-itself-already-in-a-tmux
tmux source-file ~/.tmux.conf
Add this to your dotfiles so you can run it for all panes:
source_tmux_conf() {
session=`tmux display-message -p "#S"`
for pane in $(tmux list-panes -s -F "#{pane_id}"); do
tmux send-keys -t $session.$pane "tmux source-file ~/.tmux.conf" C-m
done
}