-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Hitting ALT-F4 in the settings UI doesn't close WT #9042
Comments
@sylveon - the current mechanism of allowing actions in settings UI is implemented in
The immediate workaround is to add The discussion about better solution is here: #8767 |
There are cases where ALT-F4 isn't triggered besides the settings UI - for example if you click on the current active tab, the terminal loses focus (as shown by the cursor not flashing anymore) and ALT-F4 stops working too. |
You are correct. This happens because the TabView is getting focus on click, introducing tons of bugs other than keybinding not working: e.g., you cannot type and you have no clue why 😄. We can potentially solve the keybindings on TabView by adding KeyHandler to the TabView as well. I am not against finding a more robust way of doing it on the process level, but not sure if it worth it without preserving custom bindings. Of course this is just my humble opinion 😊 |
In my opinion ALT-F4 shouldn't be something custom, it's a shortcut that's practically system-wide so I would be okay with hardcoding it - the code I've put in the original comment works reliably for me. |
I do not disagree - I like your idea 😊 Just raising some concerns, because currently CloseWindow command is handled as regular command. Which means it can be bound to keys, and its keys theoretically should be unboundable. |
You know, I think at the end of the day this is just #8767. /dup #8767 Thanks! |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Environment
Steps to reproduce
Expected behavior
The window closes, prompting the user to close all tabs if there are more than 1
Actual behavior
Nothing happens
More details
This is seemingly because the current method to catch ALT-F4 uses a keyboard accelerator on the Terminal control itself (which doesn't have keyboard focus when the settings are opened, this is indeed reproducible when other XAML elements have the keyboard focus in a terminal tab).
A more reliable method would be to use code like the following before calling the XAML island's
PreTranslateMessage
:and then in the hosting window, handle WM_CLOSE normally, transmitting the close request to the XAML code.
I can make a PR for this, provided that always binding ALT-F4 to close window is the desired path (because the code above will prevent assignment of a custom keybinding to ALT-F4)
The text was updated successfully, but these errors were encountered: