mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
fix(nix): fish functions are wrapped in two layers
This commit is contained in:
parent
710441a578
commit
0b1cd71f58
17 changed files with 245 additions and 300 deletions
|
|
@ -1,22 +1,18 @@
|
|||
function tmux_attach --description "attach to existing tmux sessions"
|
||||
|
||||
# abandon if tmux not running
|
||||
set tmux_running (pgrep tmux)
|
||||
if [ -z "$tmux_running" ]
|
||||
return 0
|
||||
end
|
||||
|
||||
set selected (tmux list-sessions -F "#{session_name}" | fzf)
|
||||
if [ -z $selected ]
|
||||
return 0
|
||||
end
|
||||
|
||||
set -U TMUX_LAST (tmux display-message -p '#S')
|
||||
|
||||
if [ -z $TMUX ]
|
||||
tmux attach-session -t $selected
|
||||
else
|
||||
tmux switch-client -t $selected
|
||||
end
|
||||
|
||||
# abandon if tmux not running
|
||||
set tmux_running (pgrep tmux)
|
||||
if [ -z "$tmux_running" ]
|
||||
return 0
|
||||
end
|
||||
|
||||
set selected (tmux list-sessions -F "#{session_name}" | fzf)
|
||||
if [ -z $selected ]
|
||||
return 0
|
||||
end
|
||||
|
||||
set -U TMUX_LAST (tmux display-message -p '#S')
|
||||
|
||||
if [ -z $TMUX ]
|
||||
tmux attach-session -t $selected
|
||||
else
|
||||
tmux switch-client -t $selected
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue