From 9f71f3c8aa388751302b62a0af5315a20e9204ac Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Thu, 6 Mar 2025 14:07:29 +0200 Subject: [PATCH] chore(config): simplify fish open-tmux function Signed-off-by: Ismo Vuorinen --- config/fish/functions/open-tmux.fish | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config/fish/functions/open-tmux.fish b/config/fish/functions/open-tmux.fish index c0ee247..805ca88 100644 --- a/config/fish/functions/open-tmux.fish +++ b/config/fish/functions/open-tmux.fish @@ -2,9 +2,8 @@ # Dependencies: tmux # Usage: open-tmux function open-tmux --wraps='tmux attach-session -t main || tmux new-session -s main' --description 'open tmux session' - if test -z "$SSH_TTY" - if not set -q TMUX - tmux attach-session -t main || tmux new-session -s main - end + # Check if not in an SSH session and not already in a tmux session + if test -z "$SSH_TTY"; and not set -q TMUX + command tmux attach-session -t main || command tmux new-session -s main end end