fish: formatted fish functions

This commit is contained in:
Primrose 2024-07-18 01:11:23 +02:00
parent 6169d1e7ff
commit 667dce99d1
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
15 changed files with 176 additions and 176 deletions

View file

@ -1,23 +1,23 @@
function tmux_attach
# abandon if tmux not running
set tmux_running (pgrep tmux)
if [ -z "$tmux_running" ]
return 0
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 selected (tmux list-sessions -F "#{session_name}" | fzf)
if [ -z $selected ]
return 0
end
# echo "---attach---" >> /tmp/TMUX_DEBUG
# echo (cat /tmp/TMUX_LAST) >> /tmp/TMUX_DEBUG
echo (tmux display-message -p '#S') > /tmp/TMUX_LAST
# echo (cat /tmp/TMUX_LAST) >> /tmp/TMUX_DEBUG
# echo "---attach---" >> /tmp/TMUX_DEBUG
# echo (cat /tmp/TMUX_LAST) >> /tmp/TMUX_DEBUG
echo (tmux display-message -p '#S') >/tmp/TMUX_LAST
# echo (cat /tmp/TMUX_LAST) >> /tmp/TMUX_DEBUG
if [ -z $TMUX ]
tmux attach-session -t $selected
else
tmux switch-client -t $selected
end
if [ -z $TMUX ]
tmux attach-session -t $selected
else
tmux switch-client -t $selected
end
end