Skip to content

Commit

Permalink
Add options for overriding name and killing
Browse files Browse the repository at this point in the history
  • Loading branch information
ingara committed Mar 23, 2021
1 parent 0ca393d commit a88e0a8
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tmux-lazy-session
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
#!/bin/sh
#!/usr/bin/env bash

SESSION_NAME="vscode`pwd | md5`"

tmux attach-session -d -t $SESSION_NAME || tmux new-session -s $SESSION_NAME
while getopts n:k flag
do
case "${flag}" in
n) SESSION_NAME=${OPTARG};;
k) KILL_SESSION=1;;
esac
done

if [[ KILL_SESSION ]]; then
tmux kill-session -t $SESSION_NAME
else
tmux attach-session -d -t $SESSION_NAME || tmux new-session -s $SESSION_NAME
fi

0 comments on commit a88e0a8

Please sign in to comment.