Skip to content

Distinction between console and graphical programs in Windows #9

@jcgoble3

Description

@jcgoble3

Unlike Unix, Windows and Visual Studio make a distinction between console and graphical executables at compile time. Lua can be used for both, but if you use a lua.exe compiled as a console application to run a graphical program, you will get a console window on the screen that cannot be made to go away until the application exits. There is no runtime option to disable this; it has to be chosen at compile time.

The official Python distributions solve this problem by providing two executables on Windows, python.exe and pythonw.exe. python.exe is compiled as a console application, while pythonw.exe is compiled as a graphical application. Python also supports the .pyw file extension, which is tied to pythonw.exe via Windows file associations.

It would be nice to do the same here. Note that this does require some additional code, since graphical applications call a different "main" function IIRC, and you obviously would not want a REPL. The old Lua for Windows project did this (provided two executables and the extra file extension).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions