From 78ace538a6b1a038bebc360a4fee939b7629b786 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Tue, 10 Dec 2019 22:00:04 +0100 Subject: [PATCH] do not expect user input if stdin is redirected If GZDoom is built on a POSIX system without the GTK frontend and not run from a KDE session, an IWAD picker is presented on the terminal and expects the user to select a game wad. However, if stdin is redirected, this won't work, so start with the default IWAD instead. --- src/posix/sdl/i_system.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/posix/sdl/i_system.cpp b/src/posix/sdl/i_system.cpp index 8079c7209..8258c6e9b 100644 --- a/src/posix/sdl/i_system.cpp +++ b/src/posix/sdl/i_system.cpp @@ -338,6 +338,11 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad) return I_PickIWad_Cocoa (wads, numwads, showwin, defaultiwad); #endif + if (!isatty(fileno(stdin))) + { + return defaultiwad; + } + printf ("Please select a game wad (or 0 to exit):\n"); for (i = 0; i < numwads; ++i) {