microsoft / microsoft/terminal

[Windows Terminal - Context Menu]: Keyboard focus remains on the dismissed menu item after closing the context menu with the 'Esc' key.

Open
#20,593 0 comments 0 reactions 0 assignees View on GitHub
A11ySev3 A11yWCAG Area-Accessibility HCL-E+D HCL-WindowsTerminal Issue-Bug Product-Terminal WindowsTerminal_Win32
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Windows Terminal version

1.25.1912.0

### Windows build number

28120.2738

### Other Software

**Test Environment:**
OS Version: Windows 11 version 26H1 (OS Build 28120.2738)
App Name: Windows Terminal Preview
Screen Reader: Narrator

### Steps to reproduce

**Repro Steps:**
1. Launch the 'Windows Terminal' application.
2. Open a 'Windows PowerShell' tab.
3. Navigate to the tab and press the Menu key on the keyboard.
4. The tab context menu will open.
5. Navigate to the 'Split pane' option and open its submenu.
6. Navigate to the 'Duplicate Windows PowerShell' option.
7. Press the 'Esc' key to close the context menu.
8. Press the 'Enter' key.
9. Observe the behavior.

**User Experience:**
Keyboard-only users may unintentionally activate an action from a dismissed context menu because keyboard focus remains on the hidden menu item. This can result in an unexpected window being opened and makes keyboard focus behavior unpredictable.

**WCAG Reference Link:**
https://www.w3.org/WAI/WCAG21/Understanding/focus-order.html

**Attachment:**
https://onedrive.cloud.microsoft/:u:/a@rc32u9qu/S/IQBrlcXxexdpTZj_IAkk4vagAZLrSi4QtYXguB8_sWuZkO0?e=KguixQ

### Expected Behavior
- When the context menu is dismissed using the 'Esc' key, keyboard focus should return to the control that invoked the context menu, rather than remaining on the dismissed menu item.
- Pressing the 'Enter' key after closing the context menu should activate the control that currently has keyboard focus and should not trigger an item from the dismissed menu.

### Actual Behavior
- After pressing the 'Esc' key, the context menu closes, but keyboard focus remains on the previously focused 'Duplicate Windows PowerShell' menu item.
- When the 'Enter' key is pressed after the menu is dismissed, the previously focused 'Duplicate Windows PowerShell' action is triggered and a new Windows PowerShell window is opened.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in Windows Terminal Preview using the tab context menu, the Split pane submenu, and Narrator. Trace the Esc dismissal and focus handling; done means focus returns to the invoking control and pressing Enter does not activate the dismissed Duplicate Windows PowerShell item.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
accessibility, desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.