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

Uncap does not detach properly from the console #29

Open
ClausAndersen opened this issue Oct 30, 2024 · 2 comments
Open

Uncap does not detach properly from the console #29

ClausAndersen opened this issue Oct 30, 2024 · 2 comments

Comments

@ClausAndersen
Copy link

It seems that uncap does not detach from the console but rather minimizes it and hides the window. This works fine on a default install using the "Windows Console Host" (built-in).

This however breaks in the new and much improved Windows Terminal[1]. In the settings of Windows Terminal in "Startup" you can change "Default Terminal Application" from "Windows Console Host" to "Windows Terminal". It is easy to reproduce by simply swapping this setting.

When using the WIndows Terminal then uncap simply minimizes the window. This means that is still remains visible in the taskbar. It is clearly not being detached as you can Ctrl-C out of the process. And if the window is closed it will terminate uncap.

This becomes even more annoying as the Window Terminal support tabs. If you start uncap then the full window minimizes with all your active tabs. It does not help using cmd /c uncap as this is determined by the terminal.

Workaround: Keep "Windows Console Host" as "Default Terminal Application".

This might not be a huge issue but I would expect uncap to detach properly[2][3][4][5] as I happens with common Unix utilities. If I understand the code corretly we are currently cheating by using ShowWindow(h, SW_HIDE);

This was observed on Microsoft Windows [Version 10.0.19045.5011] using Windows Terminal 1.21.2911.0

[1] https://github.com/microsoft/terminal
[2] https://learn.microsoft.com/en-us/windows/console/freeconsole
[3] https://stackoverflow.com/a/47833689/3703638
[4] https://stackoverflow.com/questions/13168298/have-a-user-close-a-process-allocated-console-without-exiting-the-process
[5] https://stackoverflow.com/questions/432832/what-is-the-different-between-api-functions-allocconsole-and-attachconsole-1

@ClausAndersen
Copy link
Author

Starting using "start" shows the weakness as well but at least avoid hiding the current window:

c:\>start uncap

This starts a new window with uncap running in the foreground.

@onguarde
Copy link

https://www.elevenforum.com/t/change-default-terminal-application-in-windows-11.3410/
FYI steps for,

Workaround: Keep "Windows Console Host" as "Default Terminal Application".

i dont mind the workaround, but curious if there's any drawbacks i should be aware of in other applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants