-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Terminal doesn't close after FreeConsole() #16174
Comments
I don't quite get what the purpose of the
This is the same approach that mpv uses for its mpv.com wrapper:
Would you like to report this to ImHex? The above aside, I'm unable to reproduce the issue. Does it still happen if you update to the latest Windows Terminal (1.18)? |
Can I somehow force the app to update to 1.18? The Store won't distribute it to me. (However during dicussions with other users on the Discord someone metioned having the same Issue with WT 1.18) |
You can always grab the latest releases straight off our https://github.com/microsoft/terminal/releases page. Double-click installing the |
Good to know Thanks! WT 1.18.2822.0 behaves identical though |
Maybe I'm doing something wrong... I'm setting Windows Terminal 1.18 as my default terminal and then launch either @EXTREMEGABEL When testing this, please make sure to have tried it without any extra software running. That is, applications like ExplorerPatcher, PowerToys, Winaero, Discord, etc., all of them should be disabled or shut down (check Task Manager to be sure). Just because I don't use any of these on my work machine right now and one of them might indirectly cause issues, even if it's an issue on our side. |
Sorry for reporting something that aparrently noone here seems to be able to reproduce :D Can I put WT into some sort of advanced logging mode or something? |
A screen recording that shows the bug might help. |
Sure here you go: |
Thanks so much for doing this! We had a look at the video and the code over in imhex, as well as grabbed a trace of process startup. Here's what's happening.
This is why the repro video shows an ImHex tab that disappears before another one shows up. C:\..\ImHex $ dumpbin /headers .\imhex-gui.exe | sls subsystem
7.00 subsystem version
3 subsystem (Windows CUI) <--- here
|
(Also, I love ImHex! If you file a bug over on their end, would you mind linking it here?) |
Out of curiosity: Your description of what happens implies to me that in actuality the standard Windows Console host behaves "incorrectly". I thought they were supposed to behave identically. |
Hey, thanks for looking into this! The reason all of this is necessary to begin with is because calling |
I believe this difference is due to this fundamentally being a race condition. Windows Terminal makes it obvious, because it takes a lot longer to start and handle console API requests. (Edit: Or rather, I think it's because of the
Yes, I think doing that would be best.
This will be very difficult to achieve on Windows, because while a My recommendation would be to do it similar to how mpv does it: #16174 (comment) All in all, this issue is really unfortunate IMO, because it's sort of on us to fix, but what we need to fix is the fundamental problem of |
Thanks a lot! I did mostly the same thing that mpv does and it looks like it works fine, both using the old Conhost and the Windows Terminal :) Yeah the underlying problem here is really just Windows automatically allocating a console for us in the CONSOLE subsystem. None of this would be necessary if that wasn't the case. |
Windows Terminal version
1.17.11461.0
Windows build number
10.0.19045.0
Other Software
ImHex 1.31.0
Steps to reproduce
Set Windows Terminal to be the standard console app
Start ImHex via explorer
Expected Behavior
As ImHex calls FreeConsole() right before launching the GUI executable, the console window should close.
This works with the "standard" console host.
Actual Behavior
The Console Window stays open.
Occasionally it minimizes.
The text was updated successfully, but these errors were encountered: