diff options
| author | Franck Cuny <franck@fcuny.net> | 2022-04-24 12:56:07 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2022-04-24 12:56:07 -0700 |
| commit | bd7410f23d339fa215cbebebf7a388ac9e3e653a (patch) | |
| tree | 7f02b880581fc906d9875423b262638d7e944b0b /home | |
| parent | scanner: install tools on the laptop (diff) | |
| download | infra-bd7410f23d339fa215cbebebf7a388ac9e3e653a.tar.gz | |
fish: start tmux on new session
Unless we're in a SSH connection. If there's already a session 0, attach
to it.
Diffstat (limited to 'home')
| -rw-r--r-- | home/fish/default.nix | 9 |
1 files changed, 6 insertions, 3 deletions
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 '' |
