feat(fish): add tmux into the repos function

create a new session when outside tmux, and when inside tmux, change the name of the current session
This commit is contained in:
Sergio Laín 2024-07-30 20:43:22 +02:00
parent 048f9e3778
commit 387ca1846e
No known key found for this signature in database
GPG key ID: 8429B2EE312F8150

View file

@ -6,7 +6,13 @@ function repos --description 'Open Git directories in ~/Repos with fzf in a new
set tab_title (basename "$selected_dir") set tab_title (basename "$selected_dir")
set new_tab_cmd = "" set new_tab_cmd = ""
if type -q zellij if type -q tmux
if set -q TMUX
set new_tab_cmd "tmux rename-session \"$tab_title\"; and cd $selected_dir; and $gfetch; and l"
else
set new_tab_cmd "tmux new-session -s \"$tab_title\" -c \"$selected_dir\""
end
else if type -q zellij
if zellij ls | grep --quiet current if zellij ls | grep --quiet current
set new_tab_cmd "zellij action rename-tab \"$tab_title\"; and cd $selected_dir; and $gfetch; and l" set new_tab_cmd "zellij action rename-tab \"$tab_title\"; and cd $selected_dir; and $gfetch; and l"
end end