This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/common/bin/tmux-lyte-session

12 lines
274 B
Plaintext
Raw Permalink Normal View History

2021-06-11 21:32:54 -05:00
#!/usr/bin/env fish
2021-06-11 21:32:54 -05:00
set session_name $argv[1]
2021-12-23 12:20:59 -06:00
set dir (set -q argv[2] && echo $argv[2] || pwd)
2022-03-03 10:44:25 -06:00
if set -q TMUX
tmux switch -t $session_name
else
2022-12-13 15:34:46 -06:00
tmux new-session -D -s "$session_name" -c "$dir" $argv[3..-1] &>/dev/null || \
tmux attach -t "$session_name" -c "$dir"
2022-03-03 10:44:25 -06:00
end