From: terencehill <piuntn@gmail.com>
Date: Tue, 29 Aug 2017 12:02:31 +0000 (+0200)
Subject: MSYS2: fix dedicated servers not accepting input in the shell console. It requires... 
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1e47a79d80aa94645cc2b9a27b557d475b4aa70d;p=xonotic%2Fxonotic.git

MSYS2: fix dedicated servers not accepting input in the shell console. It requires winpty package
---

diff --git a/misc/tools/all/xonotic.subr b/misc/tools/all/xonotic.subr
index b27dcaf4..9ec0c4a0 100644
--- a/misc/tools/all/xonotic.subr
+++ b/misc/tools/all/xonotic.subr
@@ -342,7 +342,15 @@ case "$cmd" in
 		if [ x"$USE_RLWRAP" != x"no" ] && which rlwrap >/dev/null 2>&1; then
 			set -- rlwrap -A -g '^quit' -q "\"" -s 10000 -S ']' -w 100 "$@"
 		fi
+
+		# winpty fixes dedicated servers not accepting input in the shell console
+		# sadly for some reason it doesn't work for non-dedicated servers
+		if [ -n "$WE_HATE_OUR_USERS" ] && [ x"$client" == x"-dedicated" ] && which winpty >/dev/null 2>&1; then
+			set -- winpty "$@"
+		fi
+
 		rm -f xonotic.core
+
 		verbose measure_time "$@" || true
 		if [ -f xonotic.core ]; then
 			if yesno "The program has CRASHED. Do you want to examine the core dump?"; then