tmuxsess: allow session name to be customized

This commit is contained in:
Rob Watson 2021-04-03 10:55:12 +02:00
parent b964381989
commit 37a4f3c242
1 changed files with 9 additions and 2 deletions

View File

@ -2,10 +2,17 @@
# #
# Open a new tmux session named after the current directory with a basic # Open a new tmux session named after the current directory with a basic
# development/editing environment. # development/editing environment.
#
# The session will be named after the current directory unless the desired name
# is passed as the only argument.
set -e set -e
if [ -z "$1" ]; then
cwd=$(pwd) cwd=$(pwd)
sessionname=$(basename $cwd) sessionname=$(basename $cwd)
else
sessionname="$1"
fi
tmux new -d -s $sessionname tmux new -d -s $sessionname
tmux rename-window -t $sessionname:1 cli tmux rename-window -t $sessionname:1 cli
tmux new-window -t $sessionname -n vim vim tmux new-window -t $sessionname -n vim vim