[PR #17502] Add action for Quick Fix and key binding for Suggestions #31246

Open
opened 2026-01-31 09:46:04 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/17502

State: closed
Merged: Yes


Adds a keybinding to open the quick fix menu, if one is available. When the action is used, we also open up the button (if it was collapsed) because that looks nice.

The showSuggestions action is bound to ctrl+shift+period by default to align with VS' "quick actions" feature and VS Code's "quick fix" feature. This was chosen over binding to quickFix because it's more helpful. The quick fix button is a route for users that prefer to use the mouse. If users want to add a keybinding to activate the quickFix button, they can do that now.

This PR also performs a bit of miscellaneous polish from the bug bash. This includes:

  • the suggestions UI now presents quick fixes first
  • scrolling may result in the button being drawn in the wrong place
    • The bug was tracked down this line: TermControl::CursorPositionInDips() --> _core.CursorPosition() --> Terminal::GetViewportRelativeCursorPosition(). The mutable viewport there does not update when the user scrolls. Thus, the button would be drawn on the same position on the screen even though we scrolled. To fix this, I include the _scrollOffset in the calculation. The only other place this function is used is with the suggestions UI, which does not update the UIs position as we scroll (but if we're interested in doing that, we can now).

Closes #17377

**Original Pull Request:** https://github.com/microsoft/terminal/pull/17502 **State:** closed **Merged:** Yes --- Adds a keybinding to open the quick fix menu, if one is available. When the action is used, we also open up the button (if it was collapsed) because that looks nice. The `showSuggestions` action is bound to `ctrl+shift+period` by default to align with VS' "quick actions" feature and VS Code's "quick fix" feature. This was chosen over binding to `quickFix` because it's more helpful. The quick fix button is a route for users that prefer to use the mouse. If users want to add a keybinding to activate the `quickFix` button, they can do that now. This PR also performs a bit of miscellaneous polish from the bug bash. This includes: - the suggestions UI now presents quick fixes first - scrolling may result in the button being drawn in the wrong place - The bug was tracked down this line: `TermControl::CursorPositionInDips()` --> `_core.CursorPosition()` --> `Terminal::GetViewportRelativeCursorPosition()`. The mutable viewport there does _not_ update when the user scrolls. Thus, the button would be drawn on the same position _on the screen_ even though we scrolled. To fix this, I include the `_scrollOffset` in the calculation. The only other place this function is used is with the suggestions UI, which does _not_ update the UIs position as we scroll (but if we're interested in doing that, we can now). Closes #17377
claunia added the pull-request label 2026-01-31 09:46:04 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31246