microsoft / microsoft/terminal

findMatch keybindings are ignored if focus is still in the search box

Open
#9,339 1 comment 1 reaction 0 assignees View on GitHub
Area-TerminalControl Issue-Bug Priority-3 Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

# Environment

```none
Windows build number: Microsoft Windows [Version 10.0.18362.1256]
Windows Terminal version (if applicable): Windows Terminal Preview Version: 1.7.572.0

Any other software?
No
```

# Steps to reproduce

Bind find, findNext and findPrev as such:
```JSON
{
"command": "find",
"keys": "ctrl+f"
},
{
"command": {
"action": "findMatch",
"direction": "next"
},
"keys": "f3"
},
{
"command": {
"action": "findMatch",
"direction": "prev"
},
"keys": "shift+f3"
}
```
In the terminal, hit ctrl+f to start a search, enter a search term and press enter. Then press F3 and shift+F3 to go back and forth through the search results.

# Expected behavior

F3 should highlight the next search result, shift+F3 should highlight the previous result.

# Actual behavior

F3 and shift+F3 are ignored as long as focus remains in the search box. Instead enter and shift+enter hightlight the previous, respectively the next result.

If the focus is moved from the search box to the terminal pane, F3 and shift+F3 work as expected.

PS: Your release notes said I could bind the `findNext` and `findPrev` actions, when I actually had to bind the `findMatch` action with a `direction` parameter ;)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the find and findMatch bindings shown in the report, keeping focus in the search box. Trace the findMatch entry point and its handling of F3 and Shift+F3 while the search box is focused; done means both keybindings move to the next and previous search results without moving focus.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.