diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-05-02 18:26:02 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-05-02 18:26:02 -0400 |
commit | 0f27d6f4c18812d90e51b10c05bfa1a69953c721 (patch) | |
tree | 394686b9517bf6dd19dc240dff6444236b6a5e79 /src/SMAPI.Installer/assets/unix-launcher.sh | |
parent | b8b120b759f292da8b6583831de2894fe44a0012 (diff) | |
download | SMAPI-0f27d6f4c18812d90e51b10c05bfa1a69953c721.tar.gz SMAPI-0f27d6f4c18812d90e51b10c05bfa1a69953c721.tar.bz2 SMAPI-0f27d6f4c18812d90e51b10c05bfa1a69953c721.zip |
fix new executable check in Linux launcher, update release notes (#775)
Diffstat (limited to 'src/SMAPI.Installer/assets/unix-launcher.sh')
-rw-r--r-- | src/SMAPI.Installer/assets/unix-launcher.sh | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/SMAPI.Installer/assets/unix-launcher.sh b/src/SMAPI.Installer/assets/unix-launcher.sh index e0a106cb..a33c0d7f 100644 --- a/src/SMAPI.Installer/assets/unix-launcher.sh +++ b/src/SMAPI.Installer/assets/unix-launcher.sh @@ -72,42 +72,51 @@ else export TERMINAL_NAME="$(basename "$(readlink -f $(command -v x-terminal-emulator))")" fi - - if [ ! -x $TERMINAL_NAME ]; then - echo "looks like found no terminal available for launch. maybe in sandbox or misconfigured system? fallbacking to execution without terminal" - export TERM="xterm" - exec $LAUNCH_FILE $@ - else - # run in selected terminal and account for quirks + # run in selected terminal and account for quirks + export TERMINAL_PATH="$(command -v $TERMINAL_NAME)" + if [ -x $TERMINAL_PATH ]; then case $TERMINAL_NAME in terminal|termite) # consumes only one argument after -e # options containing space characters are unsupported exec $TERMINAL_NAME -e "env TERM=xterm $LAUNCH_FILE $@" ;; + xterm|konsole|alacritty) # consumes all arguments after -e exec $TERMINAL_NAME -e env TERM=xterm $LAUNCH_FILE "$@" ;; + terminator|xfce4-terminal|mate-terminal) # consumes all arguments after -x exec $TERMINAL_NAME -x env TERM=xterm $LAUNCH_FILE "$@" ;; + gnome-terminal) # consumes all arguments after -- exec $TERMINAL_NAME -- env TERM=xterm $LAUNCH_FILE "$@" ;; + kitty) # consumes all trailing arguments exec $TERMINAL_NAME env TERM=xterm $LAUNCH_FILE "$@" ;; + *) # If we don't know the terminal, just try to run it in the current shell. + # If THAT fails, launch with no output. env TERM=xterm $LAUNCH_FILE "$@" - # if THAT fails, launch with no output if [ $? -eq 127 ]; then exec $LAUNCH_FILE --no-terminal "$@" fi esac + + ## terminal isn't executable; fallback to current shell or no terminal + else + echo "The '$TERMINAL_NAME' terminal isn't executable. SMAPI might be running in a sandbox or the system might be misconfigured? Falling back to current shell." + env TERM=xterm $LAUNCH_FILE "$@" + if [ $? -eq 127 ]; then + exec $LAUNCH_FILE --no-terminal "$@" + fi fi fi |