From 334f31008dfed897adc1baab6add32dd3b4831c9 Mon Sep 17 00:00:00 2001 From: Artem Sheremet Date: Sun, 8 Feb 2026 13:58:13 +0000 Subject: [PATCH] Fix screen auto-start via SSH --- migrated/.zshrc | 4 ++-- modules/home.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/migrated/.zshrc b/migrated/.zshrc index e63d723..de62136 100644 --- a/migrated/.zshrc +++ b/migrated/.zshrc @@ -6,12 +6,12 @@ export PATH="${HOME}/bin:${PATH}" # screen session or start a new, UTF-8 capable. # # Since we exec right afterwards, there's no point in setting this shell up. -case "$0" in -*) +if [[ -o login ]]; then [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && \ [ -z "$STY" ] && \ which screen 2>/dev/null && \ exec screen -URR -esac +fi HISTFILE=~/.zsh_history # History in the file diff --git a/modules/home.nix b/modules/home.nix index 41dec2c..173060a 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -9,13 +9,13 @@ programs.zsh = { enable = true; initContent = '' - . ~/dotfiles/migrated/.zshrc - # Outside NixOS, we need to load this manually. Same on MacOS, if # /etc/zshrc is reset to its default content (post-upgrade). if [ -r /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]; then . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh fi + + . ~/dotfiles/migrated/.zshrc ''; };