Skip to content

Instantly share code, notes, and snippets.

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