Closed aquamarine-axo closed 1 year ago
Fixing this will be difficult because there isn't any way to detect a console and use it reliably.
The subsystem can only be set to either Console or Windows (for a Windows application). Setting it to Console yields the following behavior:
However, we want this behavior:
-console
is passed.AttachConsole() is not reliable as it still detaches from it as soon as it is started...
I don't want to use FreeConsole() as it will still pop a console up for a millisecond when started from Explorer...
Furthermore, setting the subsystem to Console will forgo WinMain, which I want to use...
Can't remove WinMain as something calls it:
/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld: /usr/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): in function `main':
/build/mingw-w64-crt/src/mingw-w64-v9.0.0/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
Please test with git master.
It did not make any difference, the behavior is the same as the previous commit.
Please see my remarks on Discord.
Did
Test again with git master - somebody confirmed it working.
Don't close the issue though because there's MinGW left to test (which I will enable later).
Current state of console mode:
Starting with Windows 11, it uses Windows Terminal as the default conhost
client. There was a related discussion on this issue:
https://github.com/microsoft/terminal/issues/12570
Looking into a workaround specifically for handling the Windows Terminal use case that does not involve packing in a separate EXE and launching a new process on entrypoint like various other programs. Not looking good on the grapevine though.
https://github.com/Ryujinx/Ryujinx/issues/3779 https://github.com/koishijs/koishi-desktop/issues/63#issuecomment-1279802746
For now this is resolved by #998 with the caveat that it has glitches, and identical to opening firefox
in a Linux Terminal (eg: Ubuntu), where the CLI prompt is accessible with stdout
noise pouring in.
Should a better workaround be made available, contributors are welcome to raise a PR.
Marking as not fixable. Windows issue.
Console mode appears to be broken again on Windows. It worked at some point between dev70 and dev90 as I remember testing it within that timespan but console mode simply just exits immediately when started, with no error or startup message.
Just as a form of idiot-checking, the syntax used on the command line was as follows:
I also think that having it use
-console
instead of-c
and--console
for the short and long forms respectively is a little bit odd compared to how most command line apps work on Linux systems. perhaps this should be changed to what I suggested at the start of the last sentence?