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

Stop scrolling on output when search is open #17885

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Sep 9, 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. ✅

@microsoft-github-policy-service microsoft-github-policy-service bot added Issue-Bug It either shouldn't be doing this or needs an investigation. Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Priority-1 A description (P1) Product-Terminal The new Windows Terminal. labels Sep 9, 2024
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can understand this code after having been out of the game...

@DHowett DHowett merged commit d9131c6 into main Sep 24, 2024
20 checks passed
@DHowett DHowett deleted the dev/lhecker/17301-search-reset branch September 24, 2024 19:06
DHowett pushed a commit that referenced this pull request 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 pull request 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal.
Projects
Development

Successfully merging this pull request may close these issues.

Search results steal focus and scroll when the buffer changes at all
3 participants