add TMUX_SESSION_NAME inheriting over ssh

This commit is contained in:
Jana Dönszelmann 2026-03-16 13:29:50 +01:00
parent 391b47fa75
commit bdaefa4d5c
No known key found for this signature in database
6 changed files with 22 additions and 38 deletions

View file

@ -34,7 +34,11 @@ inputs@{ machine, ... }:
draw_minimal_borders = false;
hide_window_decorations = true;
shell = "${pkgs.tmux}/bin/tmux";
shell = "${pkgs.writeScriptBin "tmux-sesh" ''
RAND=$(cat /dev/urandom | head -c 20 | base32)
export TMUX_SESSION_NAME="kitty-$RAND"
exec ${pkgs.tmux}/bin/tmux new -e TMUX_SESSION_NAME=$TMUX_SESSION_NAME -s "$TMUX_SESSION_NAME"
''}/bin/tmux-sesh";
clipboard_control = "write-clipboard write-primary read-clipboard read-primary";
foreground = "#fcfcfc";