mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
add(fish): tmux_last
This commit is contained in:
parent
4eb662e46c
commit
8ccf640808
4 changed files with 27 additions and 12 deletions
|
|
@ -1,20 +1,18 @@
|
|||
function tmux_home
|
||||
|
||||
set session_name "home"
|
||||
|
||||
# create session if doesn't exist
|
||||
if ! tmux has-session -t=$session_name 2> /dev/null
|
||||
if ! tmux has-session -t="home" 2> /dev/null
|
||||
tmux \
|
||||
new-session -ds $session_name \; \
|
||||
new-window -t $session_name \; \
|
||||
select-window -t $session_name:1
|
||||
new-session -ds "home" \; \
|
||||
new-window -t "home" \; \
|
||||
select-window -t "home":1
|
||||
end
|
||||
|
||||
# attach or switch
|
||||
set -U TMUX_LAST (tmux display-message -p '#S')
|
||||
if [ -z $TMUX ]
|
||||
tmux attach-session -t $session_name
|
||||
tmux attach-session -t "home"
|
||||
else
|
||||
tmux switch-client -t $session_name
|
||||
tmux switch-client -t "home"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue