Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an option to start uv on Windows without a console window #6801

Open
piepero opened this issue Aug 29, 2024 · 4 comments
Open

Provide an option to start uv on Windows without a console window #6801

piepero opened this issue Aug 29, 2024 · 4 comments
Labels
enhancement New feature or request windows Specific to the Windows platform

Comments

@piepero
Copy link

piepero commented Aug 29, 2024

I am using the Windows 11 Task Scheduler to periodically run a Python script using the uv --quiet run command.

The script has the .pyw file extension, and uv correctly uses pythonw.exe to run the script without a console window.

Unfortunately, uv.exe itself still opens an empty console window. It stays open until it has parsed the inline metadata, checked the dependencies and started pythonw.exe. The window is both distracting and steals the focus.

It would be great, if there was an additional flag (e.g. --hidden, --no-console) to suppress the creation of the console window.
Alternatively, it may be possible to add this functionality to the --quiet flag.

@zanieb zanieb added enhancement New feature or request windows Specific to the Windows platform labels Sep 22, 2024
@zanieb
Copy link
Member

zanieb commented Sep 22, 2024

Sorry nobody replied here. This seems reasonable, but I have no idea how it would be implemented.

@akx
Copy link
Contributor

akx commented Sep 25, 2024

On a general level, you'd need to set the windows_subsystem attribute to "windows" so no console is provided by Windows to the application.

However, the issue then is
image

– as I understand it, this is why python.exe and pythonw.exe are entirely separate executables: python.exe has the subsystem set to CONSOLE, pythonw.exe has it set to WINDOWS (and respectively, .pyw files are associated with pythonw.exe).

@zanieb
Copy link
Member

zanieb commented Sep 25, 2024

I guess we could ship a uvw.exe on Windows for this purpose? I'm definitely not an expert in this though. Is there no other way?

@akx
Copy link
Contributor

akx commented Sep 26, 2024

https://stackoverflow.com/q/19168763/51685 touches on a Windows subsystem app being able to request a console, but the comments are somewhat worrisome ("invariably works poorly"...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request windows Specific to the Windows platform
Projects
None yet
Development

No branches or pull requests

3 participants