Do not enforce -e TERMCMD args and fix TERMMODE

Enforcing -e break some possibilities to use TERMCMD that dont use it.

TERMCMD should be setup in xinit. This way, in ssh mode, the value still
is empty. This way, some custom bash or tmux config could use
it, configuring it.
master
Stacy Harper 3 years ago
parent 77420ebaf2
commit c5c5537873
No known key found for this signature in database
GPG Key ID: 5BAC92328B7C5D65
  1. 2
      configs/appcfg/xinit_template
  2. 14
      scripts/core/sxmo_terminal.sh

@ -52,6 +52,8 @@ command -v firefox && export BROWSER=firefox
#(useful for getting notifications)
#export SXMO_RTCWAKEINTERVAL=300
export TERMCMD="st -e"
# Immediately turn the screen off when locking the device
export SXMO_LOCK_SCREEN_OFF=1

@ -1,17 +1,7 @@
#!/usr/bin/env sh
# You can export a different terminal in your xinit
TERMCMD="${TERMCMD:-st}"
TERMMODE=$([ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && echo "true")
if [ "$TERMMODE" = "true" ]; then
while [ "-e" != "$1" ] || [ 0 -eq $# ]; do
shift
done
shift
else
set -- "$TERMCMD" -e "$@"
fi
# shellcheck disable=SC2086
set -- $TERMCMD "$@"
if [ -z "$*" ]; then
echo "sxmo_terminal.sh called in TERMMODE without any arguments (returning, nothing to do)" >&2

Loading…
Cancel
Save