Skip to content

Instantly share code, notes, and snippets.

@Edo78
Created October 27, 2020 15:07
Show Gist options
  • Save Edo78/6f25606587774a91260d31c9b2f2f7f6 to your computer and use it in GitHub Desktop.
Save Edo78/6f25606587774a91260d31c9b2f2f7f6 to your computer and use it in GitHub Desktop.
Shell function that wrap around tmux and create/attach to a "default" session or to a named one
tm() {
if [[ -n $1 ]]
then
sessionname=$1
else
sessionname='default'
fi
tmux new-session -A -s $sessionname
}
@Edo78
Copy link
Author

Edo78 commented Oct 27, 2020

With this function you can call tmux just with tm to create or attach to a session named default or you can call tm <session-name> to create or attach to a session name <session-name>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment