Feat/shell tmux git tooling #20

Merged
lyrathorpe merged 16 commits from feat/shell-tmux-git-tooling into main 2026-06-10 14:40:40 +01:00
Showing only changes of commit 27fc7ae6d3 - Show all commits
+22
View File
@@ -6,6 +6,7 @@
pkgs, pkgs,
config, config,
inputs, inputs,
lib,
username, username,
... ...
}: }:
@@ -95,4 +96,25 @@
}; };
}; };
}; };
# Auto-start tmux in graphical terminals (foot): opening a terminal drops
# straight into a session named "main" (attach if it exists, else create).
# Panes inside run a plain non-login zsh (tmux's default-command "${SHELL}").
# Order 200 runs this before oh-my-zsh/compinit so the exec replaces the shell
# before that setup is wasted. Guards (each prevents a real breakage):
# interactive only -> don't hijack scp/ssh-command/non-interactive shells
# $TMUX empty -> a pane's zsh won't re-exec tmux (infinite loop)
# not SSH -> don't force inbound SSH logins into a server tmux
# not VS Code -> its integrated terminal manages itself
# tmux on PATH -> exec failure would otherwise kill the login shell
# Lives here (graphical hosts only); the WSL work box never imports this.
programs.zsh.initContent = lib.mkOrder 200 ''
if [[ $- == *i* ]] \
&& [[ -z "$TMUX" ]] \
&& [[ -z "$SSH_CONNECTION" && -z "$SSH_TTY" ]] \
&& [[ "$TERM_PROGRAM" != "vscode" ]] \
&& command -v tmux >/dev/null 2>&1; then
exec tmux new-session -A -s main
fi
'';
} }