Use the user's login shell, and fix login-shell argv
Two separate problems made the terminal run the wrong shell:
Pty.create took a single argv slice and used argv[0] as both the exec path
and the argument vector's first entry. Session passed {shell, "-shell"},
so the shell received "-zsh" as an ordinary argument rather than as its
argv[0]. Bash quietly tolerated it; zsh rejects it and exits immediately,
which closed the tab and took the window down with it. The exec path and
argv are now separate parameters.
Shell resolution preferred $SHELL, which describes whichever shell launched
us rather than the one the user configured. Inside 'nix develop' that is
Nix's own minimal bash, so the terminal never opened the user's zsh. We now
read the login shell from the passwd database and keep $SHELL only as a
fallback for systems without a usable passwd entry.
shot.sh no longer forces a shell, so screenshots reflect real behavior.
This commit is contained in:
@@ -40,10 +40,6 @@ export WLR_RENDERER=pixman
|
||||
export LIBGL_ALWAYS_SOFTWARE=1
|
||||
export GSK_RENDERER=cairo
|
||||
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
|
||||
# The nix dev shell points SHELL at a minimal bash (no readline, no
|
||||
# programmable completion), which makes screenshots look broken for reasons
|
||||
# that have nothing to do with vtabs. Use the system shell instead.
|
||||
export SHELL="${VTABS_SHOT_SHELL:-/bin/bash}"
|
||||
export SWAYSOCK="$RUNDIR/sway.sock"
|
||||
# Don't let the app fall back to the real session.
|
||||
unset DISPLAY
|
||||
|
||||
Reference in New Issue
Block a user