forge
Explore
Log in

Don't you dare go Hollow

niri-session: Pass -l to the $SHELL

Browse files at this commit

2f87f3846bf9e6e7e02db398bee1b42dc24b106fIvan MolodetskikhParent: e1d3b0c
Apparently, despite being documented in the bash reference manual and
the bash manpage, the `-` prepended to `$0` does *not* make bash exec
profile files in its default build configuration. It happened to work so
far because distros tend to build bash with a define that makes it work
as documented.

I've no idea if all reasonable login $SHELLs accept -l as an argument,
let's hope they do. This lets us drop dependency on bash.
resources/niri-sessionmodified+1 -1
@@ -15,7 +15,7 @@ if [ -n "$SHELL" ] &&
1515 ! (echo "$SHELL" | grep -q "false") &&
1616 ! (echo "$SHELL" | grep -q "nologin"); then
1717 if [ "$1" != '-l' ]; then
18- exec bash -c "exec -l '$SHELL' -c 'exec $0 -l $*'"
18+ exec "$SHELL" -l -c "exec $0 -l $*"
1919 else
2020 shift
2121 fi