mCRL2
mCRL2 copied to clipboard
Graphical tools produce no text output on Windows
Executing ltsgraph --help
produces no output in Windows Terminal, Command Prompt and Powershell on Windows 10 (and 11) version 10.019044. This is with the latest release, but the same applies to the previous release. Command line tools such as lps2lts
do produce output just fine:
PS C:\Users\mlaveaux> lps2lts --version
lps2lts mCRL2 toolset 202206.0 (Release)
Copyright (c) 2022 Technische Universiteit Eindhoven.
This is free software. You may redistribute copies of it under the
terms of the Boost Software License <http://www.boost.org/LICENSE_1_0.txt>.
There is NO WARRANTY, to the extent permitted by law.
Written by Wieger Wesselink.
Passing a filename to ltsgraph
does work, so the arguments seem to be parsed. Control to the terminal is also immediately returned after starting ltsgraph
, which might be related.
I can reproduce this for command prompt and powershell on Windows 10. The correct output does appear when using git bash.
This seems to be related to the fact that graphical tools are built with 'WIN32_EXECUTABLE' set to true. This results in the entry point being WinMain instead of main, which makes it a graphical application. Microsoft in their infinite wisdom decided that console and graphical tools are mutual exclusive, and no text output is shown for graphical applications. Note that it is still there as it shows up in git bash.
Some applications like blender have managed to work around these limitations. It shows textual output when started from command prompt and no terminal when launched from explorer. However, this seems to require quite a bit of effort to implement. Similar hacks have been implemented in mCRL2 before as shown in issue #759, but if this is how applications are supposed to work on Windows then I propose that we do not work around it.
This is just how programs behave under Windows and users can use a terminal emulator that does show standard output, the program behaves conform the expectations set by the OS.