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

Avoid querying for cursor position when it's not necessary #4448

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Feb 4, 2025

PR Summary

Fix #3879

The lagging is due to PSReadLine queries for cursor position for every key stroke even when it's unnecessary.
 
This change avoids querying for cursor position when it's not necessary. Also skip terminal window resizing check when we've rendered very recently (< 50ms), because a window resizing is unlikely to happen in such a short time interval.

The change has been verified by the user: #3879 (comment)

PR Checklist

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Make sure you've added one or more new tests. Cannot add automation test for this change, but it's verified by the user, see When upgrading from PSReadLine 2.1 to 2.2, Pasting on remote machines gets slow towards end #3879 (comment)
  • Make sure you've tested these changes in terminals that PowerShell is commonly used in (i.e. conhost.exe, Windows Terminal, Visual Studio Code Integrated Terminal, etc.)
  • User-facing changes
    • Not Applicable
    • OR
    • Documentation needed at PowerShell-Docs
      • Doc Issue filed:
Microsoft Reviewers: Open in CodeFlow

@daxian-dbw daxian-dbw merged commit a272810 into PowerShell:master Feb 4, 2025
2 checks passed
@daxian-dbw daxian-dbw deleted the lagging branch February 4, 2025 22:02
@mhintzke
Copy link

mhintzke commented Feb 6, 2025

@daxian-dbw Appreciate the PR! Is there a good way to know when the next release will go out with this change or should we just check back in on the repository every couple weeks? Thanks!

@daxian-dbw
Copy link
Member Author

@mhintzke The v2.4.1-beta1 PSReadLine was released: https://github.com/PowerShell/PSReadLine/releases/tag/v2.4.1-beta1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When upgrading from PSReadLine 2.1 to 2.2, Pasting on remote machines gets slow towards end
2 participants