mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
13 lines
470 B
Fish
13 lines
470 B
Fish
function __tmux-maybe-create \
|
|
--description "Create a tmux session with sensible defaults if it doesn't exist yet"
|
|
### Arguments:
|
|
set session_name $argv[1]
|
|
set session_dir $argv[2]
|
|
|
|
if pgrep tmux 2>&1 >/dev/null; or ! tmux has -t=$session_name 2>/dev/null
|
|
# Note:
|
|
# Maybe it can be interesting to read from an envvar of array, where each element is a call back
|
|
tmux new-session -ds $session_name -c $session_dir
|
|
end
|
|
|
|
end
|