Skip to content

Instantly share code, notes, and snippets.

@nyarly
Created February 6, 2015 20:05
Show Gist options
  • Save nyarly/ef979bd61e8ea3829f47 to your computer and use it in GitHub Desktop.
Save nyarly/ef979bd61e8ea3829f47 to your computer and use it in GitHub Desktop.
function autotmux --on-variable TMUX_SESSION_NAME
if test -n "$TMUX_SESSION_NAME" #only if set
if test -z $TMUX #not if in TMUX
tmux new-session -t $TMUX_SESSION_NAME; or tmux new-session -s $TMUX_SESSION_NAME
end
end
end
@nyarly
Copy link
Author

nyarly commented Feb 6, 2015

I use fish, tmux, direnv and autojump, so this lets me:

~> j proj

and always get put into a named Tmux session - linked to an existing one if there is one.

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