Skip to content

Instantly share code, notes, and snippets.

@codekirei
codekirei / tmux-hybrid-attach.sh
Created June 27, 2014 20:36
A simple shell script that determines if a specific named tmux session exists then attaches to it or creates it.
#!/bin/zsh
grepTest=$(tmux list-sessions | grep $1)
if [ ! $grepTest ]; then
tmux new -s $1
else
tmux attach -t $1
fi