[Settings] : System menu pop-up doesn't open inside 'Settings' window, when user press 'Alt + Space' key. #16167

Closed
opened 2026-01-31 04:59:32 +00:00 by claunia · 7 comments
Owner

Originally created by @Saiteja341 on GitHub (Dec 16, 2021).

Originally assigned to: @carlos-zamora on GitHub.

Windows Terminal version

1.12.3472.0

Windows build number

22509.1011

Other Software

**Test Environment: **
OS: Windows 11 Version Dev (OS Build 22509.1011)
App: Windows Terminal Preview

Steps to reproduce

**Repro Steps: **

1.Open Windows Terminal.
2.Open Settings page using 'Ctr+,'
3.Now try to open the 'System menu' pop-up by pressing 'Alt + Space' key.
4.Observe the issue.

**User Experience: **
Users will not be able to 'System menu' pop-up functionalities in 'Settings' window, if System menu pop-up doesn't open inside 'Settings' window on pressing 'Alt + Space' key.

Attachment :
System menu pop-up doesn't open inside 'Settings' window, when user press 'Alt + Space' key..zip

Expected Behavior

System menu pop-up should open inside 'Settings' window, when user press 'Alt + Space' key.

Actual Behavior

System menu pop-up doesn't open inside 'Settings' window, when user press 'Alt + Space' key.

Originally created by @Saiteja341 on GitHub (Dec 16, 2021). Originally assigned to: @carlos-zamora on GitHub. ### Windows Terminal version 1.12.3472.0 ### Windows build number 22509.1011 ### Other Software **Test Environment: ** OS: Windows 11 Version Dev (OS Build 22509.1011) App: Windows Terminal Preview ### Steps to reproduce **Repro Steps: ** 1.Open Windows Terminal. 2.Open Settings page using 'Ctr+,' 3.Now try to open the 'System menu' pop-up by pressing 'Alt + Space' key. 4.Observe the issue. **User Experience: ** Users will not be able to 'System menu' pop-up functionalities in 'Settings' window, if System menu pop-up doesn't open inside 'Settings' window on pressing 'Alt + Space' key. Attachment : [System menu pop-up doesn't open inside 'Settings' window, when user press 'Alt + Space' key..zip](https://github.com/microsoft/terminal/files/7728290/System.menu.pop-up.doesn.t.open.inside.Settings.window.when.user.press.Alt.%2B.Space.key.zip) ### Expected Behavior System menu pop-up should open inside 'Settings' window, when user press 'Alt + Space' key. ### Actual Behavior System menu pop-up doesn't open inside 'Settings' window, when user press 'Alt + Space' key.
Author
Owner

@zadjii-msft commented on GitHub (Jan 3, 2022):

Huh. Sure doesn't. Probably should. I'm guessing there's some magic reason that Alt+Space isn't delivered to the SUI, which is causing us to never raise a OpenSystemMenu action, so it never gets to TerminalPage::_HandleOpenSystemMenu. That's where I'd start.

@zadjii-msft commented on GitHub (Jan 3, 2022): Huh. Sure doesn't. Probably should. I'm guessing there's some magic reason that Alt+Space isn't delivered to the SUI, which is causing us to never raise a `OpenSystemMenu` action, so it never gets to `TerminalPage::_HandleOpenSystemMenu`. That's where I'd start.
Author
Owner

@zadjii-msft commented on GitHub (Aug 2, 2022):

Note to selves: it just generally doesn't work from the command palette either. Why does it need to go through a TermControl? that's weird.

Or read-only panes. weird.

@zadjii-msft commented on GitHub (Aug 2, 2022): Note to selves: it just generally doesn't work from the command palette either. Why does it need to go through a `TermControl`? that's weird. Or read-only panes. weird.
Author
Owner

@ianjoneill commented on GitHub (Aug 8, 2022):

So the reason this doesn't work in the settings UI is because Alt + Space is special cased in the app's main method to delegate through to AppHost::OnDirectKeyEvent(), which in turn delegates through to AppLogic::OnDirectKeyEvent().

This method iterates through the UI tree and passes the key event through to IDirectKeyListener implementations - of which the settings UI's MainPage isn't one.

Hitting Alt + Space in the command palette doesn't work either - it does implement IDirectKeyListener, but only seems to care about the Alt key-up event and doesn't handle Alt + Space.

I've been looking at this for a while now, and can't come up with a nice way of refactoring the code so that hitting Alt + Space works in all three places. The TermControl logic below doesn't refactor out (I was thinking up to AppLogic) well - as it uses methods on ControlSettings, which AppLogic (or MainPage for that matter) doesn't know anything about.

210a98e449/src/cascadia/TerminalControl/TermControl.cpp (L963-L988)

Oddly, the "Open system menu" action does work if you click it from within the command palette - it just doesn't work if you press the enter key with it highlighted. In both cases the action does fire, and IslandWindow::OpenSystemMenu() does get called - but when enter is pressed, the call to TrackPopupMenu() doesn't seem to do anything.

@ianjoneill commented on GitHub (Aug 8, 2022): So the reason this doesn't work in the settings UI is because `Alt` + `Space` is special cased in the app's main method to delegate through to `AppHost::OnDirectKeyEvent()`, which in turn delegates through to `AppLogic::OnDirectKeyEvent()`. This method iterates through the UI tree and passes the key event through to `IDirectKeyListener` implementations - of which the settings UI's `MainPage` isn't one. Hitting `Alt` + `Space` in the command palette doesn't work either - it does implement `IDirectKeyListener`, but only seems to care about the `Alt` key-up event and doesn't handle `Alt` + `Space`. I've been looking at this for a while now, and can't come up with a nice way of refactoring the code so that hitting `Alt` + `Space` works in all three places. The `TermControl` logic below doesn't refactor out (I was thinking up to `AppLogic`) well - as it uses methods on `ControlSettings`, which `AppLogic` (or `MainPage` for that matter) doesn't know anything about. https://github.com/microsoft/terminal/blob/210a98e44940f880175436b050151fb8c1e4b45d/src/cascadia/TerminalControl/TermControl.cpp#L963-L988 Oddly, the "Open system menu" action does work if you click it from within the command palette - it just doesn't work if you press the enter key with it highlighted. In both cases the action does fire, and `IslandWindow::OpenSystemMenu()` does get called - but when enter is pressed, the call to `TrackPopupMenu()` doesn't seem to do anything.
Author
Owner

@carlos-zamora commented on GitHub (Oct 13, 2022):

Originally filed in MSFT-41390832

@carlos-zamora commented on GitHub (Oct 13, 2022): Originally filed in MSFT-41390832
Author
Owner

@ghost commented on GitHub (Oct 18, 2022):

:tada:This issue was addressed in #14221, which has now been successfully released as Windows Terminal v1.15.2874.🎉

Handy links:

@ghost commented on GitHub (Oct 18, 2022): :tada:This issue was addressed in #14221, which has now been successfully released as `Windows Terminal v1.15.2874`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.15.2874) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@Shubham786786 commented on GitHub (Nov 10, 2022):

Closing the bug as issue is fixed on the latest build:
Windows Terminal Preview Version: 1.17.3052.0

@Shubham786786 commented on GitHub (Nov 10, 2022): Closing the bug as issue is fixed on the latest build: Windows Terminal Preview Version: 1.17.3052.0
Author
Owner

@ghost commented on GitHub (Dec 14, 2022):

:tada:This issue was addressed in #14221, which has now been successfully released as Windows Terminal Preview v1.16.3463.0 and v1.16.3464.0.🎉

Handy links:

@ghost commented on GitHub (Dec 14, 2022): :tada:This issue was addressed in #14221, which has now been successfully released as `Windows Terminal Preview v1.16.3463.0 and v1.16.3464.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.16.3464.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16167