scp-fs2open / fs2open.github.com

Origin Repository for SCP FreeSpace 2 Open
https://www.hard-light.net/
Other
407 stars 164 forks source link

Console hangs up when trying to use -get_flags on Windows #3997

Open z64555 opened 2 years ago

z64555 commented 2 years ago

No idea whats going on here.

I'm able to run an FSO build through the debugger with -get_flags json_v1 > flags.txt and the flags.txt file is populated accordingly, but when trying to do the same manuever from a command prompt or powershell, the .json object spews into the console and the flags.txt is empty.

This is a potential snag to anybody who wants to try out the new multi-joy feature, since nuKnossos hasn't been completed yet, the only way to get the correct GUID's for their joysticks is via FSO.

BMagnu commented 2 years ago

This is due to the console reattach shenanigans we do here: https://github.com/scp-fs2open/fs2open.github.com/blob/6cebcfc9ac6b5556f96de7b59b1ae1bd40897f8e/freespace2/freespace.cpp#L7655-L7669 In fact, if I set this "FSO_KEEP_STDOUT" EnvVar, I can pipe these to a file: cmd /V /C "set FSO_KEEP_STDOUT=1&& fs2_open.exe -get_flags json_v1 > flags.txt" This works just fine for disabling the reattach for a single evocation of FSO (note that this command is fickle, the missing space after the 1 of the set is mandatory, as is the /V option of the cmd).

As for the actual hangup that seems to occur when calling the command without the EnvVar: This is just due to a missing newline at the end of the print. Hit return, and it'll be back to normal.

z64555 commented 2 years ago

See, I tried setting the envar, but I must've done something wrong. I'll try giving this a go later today.

The point of all this is to try to get something that end users can use as a backup in case the launcher doesn't support multi-joy, which I have somehow had the curse (or blessing?) to keep running into issues with piping the output of -get_flags int a .txt.