From 6f8099604093942d13762283a24c95d8bf8d2e25 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 17 Apr 2022 19:07:25 +0200 Subject: [PATCH] screenrc: use full path in "shell" option GNU screen uses the value of "shell" for the $SHELL environment variable. Having a non-absolute path there can cause issues. For example, `ssh` uses $SHELL when running "Match exec" commands which fail because it uses access() to verify if the shell exists. --- shell/screenrc.in | 4 ++-- shell/setup.sh | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/shell/screenrc.in b/shell/screenrc.in index 19bd786..75f3f2d 100644 --- a/shell/screenrc.in +++ b/shell/screenrc.in @@ -35,8 +35,8 @@ defscrollback 50000 ignorecase on # I prefer zsh as my shell. GNU screen displays a warning if the shell isn't -# available. -shell zsh +# available. Also used for $SHELL environment variable. +shell ZSH # Don't "login" windows (= add them to the utmp database) by default. Not # useful for me and the "$" flag clutters the window flags (displayed with diff --git a/shell/setup.sh b/shell/setup.sh index 084193e..edb209f 100755 --- a/shell/setup.sh +++ b/shell/setup.sh @@ -133,6 +133,9 @@ if ! lsblk --merge >/dev/null 2>&1; then fi generate screenrc .in cat +# Use absolute path for "shell" option for proper $SHELL variable. +apply_optional_replacement screenrc \ + zsh ZSH "`installed_path zsh`" # As screen-256color is not widely supported use it only on machines where the # matching terminfo entry is available. This also requires a terminal emulator # which supports 256 colors. Also used for tmux. -- 2.43.2