[Closed by Request] stdout silent on conhost.exe

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

stdout silent on conhost.exe

Postby gramps » Wed Mar 13, 2019 11:22 pm

In the gzdoom-x64-g3.8pre-633-gd5410a882.7z devbuild, nothing gets sent to stdout in conhost.exe (or "Console Window Host," the shell used by WSL). The -stdout switch seems to be ignored. In previous builds, this worked.

The cmd.exe shell still prints messages to stdout.

I'm running Fish shell on Debian under WSL, if that matters. Not sure exactly what the last working build was, haven't updated since shortly after the somewhat recent rollback related to level de-globalization.
gramps
 
Joined: 18 Oct 2018

Re: stdout silent on conhost.exe

Postby _mental_ » Thu Mar 14, 2019 9:25 am

For some reason WSL console doesn't support WriteConsoleW(). The error code is 1, ERROR_INVALID_FUNCTION.
If we really need to support such setup, an additional check is needed before enabling FancyStdOut.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: stdout silent on conhost.exe

Postby gramps » Thu Mar 14, 2019 12:34 pm

Support for this would be much appreciated, if it's not too much trouble. The cmd.exe thing really is barely usable for anything serious.
gramps
 
Joined: 18 Oct 2018

Re: stdout silent on conhost.exe

Postby Graf Zahl » Thu Mar 14, 2019 2:34 pm

You may be the first person ever to use the -stdout option on Windows - but you are most definitely the first person to use such a weird non-standard setup.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: stdout silent on conhost.exe

Postby Rachael » Thu Mar 14, 2019 4:53 pm

Oh no, I use -stdout for diagnostic purposes. I usually put the output in a logfile if I do that. I really hate how it resets my console colours though.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: stdout silent on conhost.exe

Postby Graf Zahl » Thu Mar 14, 2019 5:01 pm

To create a log output I normally use +logfile instead of having to cope with Windows's annoying console handling. The colorization struck me as a pointless gimmick, especially since it requires using a special output function for this. The console's Unicode handling is also surprisingly bad, even with the W function used for output, because the default font is far too limited. I wouldn't really mind removing that part of the code because I cannot imagine anybody using the Windows console as a stand-in for the internal log window which is infinitely preferable.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: stdout silent on conhost.exe

Postby gramps » Thu Mar 14, 2019 8:40 pm

The built-in log window is alright, but I find it a little less convenient for two reasons: there doesn't seem to be a way to copy the text there to the clipboard, and if the game runs successfully, the window disappears. The log is still in the game console, but I can't copy that text either, and I need to hit another key to view it instead of seeing it instantly, alongside the game in another window.

On the other hand, there are some internal errors that only seem to appear in the internal log, and never get printed to stdout. These messages usually appear in red in the internal log.

I wasn't aware of the +logfile feature. I just tried setting `+logfile /dev/stdout` as a workaround, but no luck with that either.
gramps
 
Joined: 18 Oct 2018

Re: stdout silent on conhost.exe

Postby Rachael » Thu Mar 14, 2019 9:48 pm

You cannot use UNIX /dev/ devices with GZDoom in Windows - it's compiled with MSVC so it won't even work.

Use the DOS equivilent +logfile con, instead. +logfile \\.\device\con (NT version) may also work. Just tested - that does not work. It appears that GZDoom does not even make any attempt to bind to the console without "-stdout" - it makes me wonder what kind of black magic it uses to bind to the console in the first place with it. (Probably looks for its launch PID)
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: stdout silent on conhost.exe

Postby gramps » Thu Mar 14, 2019 10:09 pm

Apparently the output isn't flushed to the log until the program terminates anyway... Tested with `+logfile log & tail -F log`, but no luck.
gramps
 
Joined: 18 Oct 2018

Re: stdout silent on conhost.exe

Postby Rachael » Thu Mar 14, 2019 10:21 pm

The windows kernel *does* recognized UNC names to named pipes. I believe they are called \\.\pipe\<pipename>. (The \'s may need to be escaped in GZDoom - i.e. "\\\\.\\pipe\\<pipename>") The problem is - I don't know how to get mingw/cygwin tools to use those. So I don't know how to get tail to call that. It might work as-is but don't count on it.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: stdout silent on conhost.exe

Postby gramps » Thu Mar 14, 2019 10:37 pm

Thanks, messed around with that a bit but couldn't figure anything out.

I did find this: https://github.com/Microsoft/console/issues/89

I guess this means WriteConsoleW should start working in an upcoming WSL release. That ticket was closed some time ago, but I'm not sure what the release cycle for WSL looks like.
gramps
 
Joined: 18 Oct 2018

Re: stdout silent on conhost.exe

Postby gramps » Sat Mar 16, 2019 12:15 am

Turns out this was (mostly) fixed in the October update, so this can probably be closed.

There's an issue with carriage returns, will open a new bug report for that.
gramps
 
Joined: 18 Oct 2018


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests