Skip to content

Instantly share code, notes, and snippets.

@christianroman
Last active December 17, 2015 20:09
Show Gist options
  • Save christianroman/5665218 to your computer and use it in GitHub Desktop.
Save christianroman/5665218 to your computer and use it in GitHub Desktop.
Restore tmux session after reboot
#!/bin/zsh
SESSIONNAME="script"
tmux has-session -t $SESSIONNAME &> /dev/null
if [ $? != 0 ]
then
tmux new-session -s $SESSIONNAME -n script -d
tmux send-keys -t $SESSIONNAME "~/bin/script" C-m
fi
tmux attach -t $SESSIONNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment