Skip to content

Fix Export Tab leaking Enter via Command Palette#20358

Open
carlos-zamora wants to merge 1 commit into
mainfrom
dev/cazamor/bugfix/export-text-enter
Open

Fix Export Tab leaking Enter via Command Palette#20358
carlos-zamora wants to merge 1 commit into
mainfrom
dev/cazamor/bugfix/export-text-enter

Conversation

@carlos-zamora

Copy link
Copy Markdown
Member

Summary of the Pull Request

Fixes a bug where Enter would leak into the terminal session when running the export buffer command from the command palette.

Turns out this is because _ExportTab() opens the file picker synchronously in the key handler. The file picker spins a nested Win32 modal message loop, which pumps the queued WM_CHAR into the terminal.

Switching to the foreground thread gets out of the nested modal loop, resulting in the WM_CHAR being handled through XAML's pipeline and suppressing it normally. The low priority makes it so that the command palette is visibly dismissed before opening the file picker.

Validation Steps Performed

Run export buffer action from the command palette.
✅ Enter does not go through to the underlying terminal.

PR Checklist

Closes #20188
Based on #20221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Consider
Status: To Consider

Development

Successfully merging this pull request may close these issues.

"Export text" action invoked from cmd paletter forwards Enter key

1 participant