Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search results steal focus and scroll when the buffer changes at all #17301

Closed
Rodrigodd opened this issue May 22, 2024 · 1 comment · Fixed by #17885
Closed

Search results steal focus and scroll when the buffer changes at all #17301

Rodrigodd opened this issue May 22, 2024 · 1 comment · Fixed by #17885
Assignees
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Terminal The new Windows Terminal.

Comments

@Rodrigodd
Copy link

Windows Terminal version

1.21.1272.0

Windows build number

10.0.22631.0

Other Software

No response

Steps to reproduce

  • Fill the buffer with enough text to make it scrollable (for example, using Get-Random -Count 1000 in PowerShell),
  • search something in such a way that the last result is outside the view,
  • select a search result which is not the last (optinal),
  • type something in the prompt.

Expected Behavior

While typing in the prompt nothing happen, the select result stays the same, and the view focus the prompt.

Actual Behavior

When typing, the search appear to retrigger, and the focus goes to the last result, moving the prompt outside view.

@Rodrigodd Rodrigodd added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 22, 2024
@DHowett
Copy link
Member

DHowett commented May 22, 2024

Hey, I've been hitting this too!

Marking it up for 1.22 and as P1 - we should fix it and backport to 1.21 before 1.21 goes stable.

@DHowett DHowett added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. Priority-1 A description (P1) and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 22, 2024
@DHowett DHowett added this to the Terminal v1.22 milestone May 22, 2024
@DHowett DHowett changed the title When trying to type in prompt, first search result is forced-focus into view Search results steal focus and scroll, when the buffer changes at all Aug 22, 2024
@DHowett DHowett changed the title Search results steal focus and scroll, when the buffer changes at all Search results steal focus and scroll when the buffer changes at all Aug 22, 2024
@lhecker lhecker self-assigned this Aug 26, 2024
@lhecker lhecker moved this to To Cherry Pick in 1.22 Servicing Pipeline Sep 9, 2024
@github-project-automation github-project-automation bot moved this to To Cherry Pick in 1.21 Servicing Pipeline Sep 9, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Sep 9, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Sep 24, 2024
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.22 Servicing Pipeline Sep 24, 2024
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.21 Servicing Pipeline Sep 24, 2024
DHowett pushed a commit that referenced this issue Sep 24, 2024
* Don't reset the position entirely when changing the needle
* Don't change the scroll position when output arrives
* Don't interfere with the search when output arrives constantly

Closes #17301

## Validation Steps Performed
* In pwsh, run `10000..20000 | % { sleep 0.25; $_ }`
  * You can search for e.g. `1004` and it'll find 10 results. ✅
  * You can scroll up and down past it and it won't snap back
    when new output arrives. ✅
* `while ($true) { Write-Host -NoNewline "`e[Ha"; sleep 0.0001; }`
  * You can cycle between the hits effortlessly. ✅ (This tests that
    the constantly reset `OutputIdle` event won't interfere.)
* On input change, the focused result is near the previous one. ✅

(cherry picked from commit d9131c6)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgS3elk PVTI_lADOAF3p4s4AmhmszgTEciI
Service-Version: 1.21
DHowett pushed a commit that referenced this issue Sep 24, 2024
* Don't reset the position entirely when changing the needle
* Don't change the scroll position when output arrives
* Don't interfere with the search when output arrives constantly

Closes #17301

## Validation Steps Performed
* In pwsh, run `10000..20000 | % { sleep 0.25; $_ }`
  * You can search for e.g. `1004` and it'll find 10 results. ✅
  * You can scroll up and down past it and it won't snap back
    when new output arrives. ✅
* `while ($true) { Write-Host -NoNewline "`e[Ha"; sleep 0.0001; }`
  * You can cycle between the hits effortlessly. ✅ (This tests that
    the constantly reset `OutputIdle` event won't interfere.)
* On input change, the focused result is near the previous one. ✅

(cherry picked from commit d9131c6)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgS3elo PVTI_lADOAF3p4s4AmhmQzgTEciM
Service-Version: 1.22
@DHowett DHowett moved this from Cherry Picked to Shipped in 1.21 Servicing Pipeline Oct 2, 2024
@DHowett DHowett moved this from Cherry Picked to Shipped in 1.22 Servicing Pipeline Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Terminal The new Windows Terminal.
Projects
Development

Successfully merging a pull request may close this issue.

4 participants