Skip to content

Commit

Permalink
do not expect user input if stdin is redirected
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fabiangreffrath authored and alexey-lysiuk committed Dec 11, 2019
1 parent 194dd3e commit cc7807b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/posix/sdl/i_system.cpp
Expand Up @@ -260,6 +260,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)
{
Expand Down

0 comments on commit cc7807b

Please sign in to comment.