Disable stty in launchers if stdin is not a terminal

develop
lethosor 2020-03-26 22:58:43 -04:00
parent 90e0c29a5c
commit 9c5e5de999
2 changed files with 12 additions and 0 deletions

@ -17,6 +17,12 @@ if ! test -f hack/quarantine-removed; then
echo "quarantine flag removed on $(date); remove this file to re-run" > hack/quarantine-removed echo "quarantine flag removed on $(date); remove this file to re-run" > hack/quarantine-removed
fi fi
if [ ! -t 0 ]; then
stty() {
return
}
fi
old_tty_settings=$(stty -g) old_tty_settings=$(stty -g)
DYLD_INSERT_LIBRARIES=./hack/libdfhack.dylib ./dwarfort.exe "$@" DYLD_INSERT_LIBRARIES=./hack/libdfhack.dylib ./dwarfort.exe "$@"
stty "$old_tty_settings" stty "$old_tty_settings"

@ -48,6 +48,12 @@ $HOME/$RC to affect future DFHack installations:
EOF EOF
fi fi
if [ ! -t 0 ]; then
stty() {
return
}
fi
# Save current terminal settings # Save current terminal settings
old_tty_settings=$(stty -g) old_tty_settings=$(stty -g)