From 387ca1846ed143ca65e3866509317ec64278256a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Tue, 30 Jul 2024 20:43:22 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(fish):=20add=20tmux=20into=20t?= =?UTF-8?q?he=20repos=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit create a new session when outside tmux, and when inside tmux, change the name of the current session --- .config/fish/functions/repos.fish | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.config/fish/functions/repos.fish b/.config/fish/functions/repos.fish index 6e9203bb..b6af7538 100644 --- a/.config/fish/functions/repos.fish +++ b/.config/fish/functions/repos.fish @@ -6,7 +6,13 @@ function repos --description 'Open Git directories in ~/Repos with fzf in a new set tab_title (basename "$selected_dir") 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 set new_tab_cmd "zellij action rename-tab \"$tab_title\"; and cd $selected_dir; and $gfetch; and l" end