Skip to content

Commit

Permalink
Fix accidentally exiting the user's shell on boot
Browse files Browse the repository at this point in the history
  • Loading branch information
TLATER committed May 13, 2017
1 parent eb40bd3 commit 34e9094
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/dialog.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ get_session_with_dialog() (
dialog --title "blm" --menu "$PS3" "$HEIGHT" "$WIDTH" "$ITEMHEIGHT" $session_nums 2>/tmp/blm

if [ $? -eq 1 ]; then
exit
return
fi

reply=$(( $(cat "/tmp/blm") - 1))
Expand Down
4 changes: 2 additions & 2 deletions src/init.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
check_env() {
# Don't re-launch blm in this session.
if [ ! -z "${NOLM+x}" ]; then
exit 1
exec "$SHELL"
fi

export NOLM=true

# Ensure that we are in a login shell.
if [[ ! $(tty) == "/dev/tty"[0-9]* ]]; then
exit 1
exec "$SHELL"
fi
}

Expand Down
4 changes: 2 additions & 2 deletions src/main.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

error() {
echo "$1" >2
exit 1
exec "$SHELL"
}

# Get the current tty and an available display
Expand Down Expand Up @@ -42,7 +42,7 @@ fi

session=$(cat "/tmp/blm")
if [ ! -f "$session" ]; then
exit
exec "$SHELL"
fi

if [[ "$session" == "$XSESSIONS"* ]]; then
Expand Down

0 comments on commit 34e9094

Please sign in to comment.