mirror of
https://github.com/turtlebasket/env.git
synced 2026-03-04 19:44:26 -08:00
misc tweaks; cleanup irrelevant
This commit is contained in:
13
scripts/tmux2
Executable file
13
scripts/tmux2
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# simple wrapper for tmux that creates a new session for current directory if one doesn't exist
|
||||
# meant for scoping sessions by /Projects/<project-name>/
|
||||
|
||||
session="$(basename "$PWD")"
|
||||
|
||||
tmux has-session -t "$session" 2>/dev/null
|
||||
if [[ $? -eq 0 ]]; then
|
||||
exec tmux attach -t "$session"
|
||||
else
|
||||
exec tmux new -s "$session"
|
||||
fi
|
||||
Reference in New Issue
Block a user