X Tutup
Skip to content

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

Merged
daxian-dbw merged 2 commits intoPowerShell:masterfrom
daxian-dbw:lagging
Feb 4, 2025
Merged

Avoid querying for cursor position when it's not necessary#4448
daxian-dbw merged 2 commits intoPowerShell:masterfrom
daxian-dbw:lagging

Conversation

@daxian-dbw
Copy link
Copy Markdown
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

Loading
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

X Tutup