From bd7410f23d339fa215cbebebf7a388ac9e3e653a Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 24 Apr 2022 12:56:07 -0700 Subject: fish: start tmux on new session Unless we're in a SSH connection. If there's already a session 0, attach to it. --- home/fish/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'home') diff --git a/home/fish/default.nix b/home/fish/default.nix index 5556ed2..85ff30d 100644 --- a/home/fish/default.nix +++ b/home/fish/default.nix @@ -11,10 +11,13 @@ in { interactiveShellInit = '' set fish_greeting - # Tmux on terminal start + # Tmux on terminal start, unless we're in a SSH connection if status is-interactive - and not set -q TMUX - exec tmux + if test -z "$SSH_CONNECTION" + if not tmux has-session 2>/dev/null; or test -z "$TMUX" + exec tmux new-session -A -s 0 + end + end end ''; loginShellInit = lib.mkIf swayEnabled '' -- cgit 1.4.1