Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Make PSReadLine script hidden from debugger#3629

Merged
andyleejordan merged 1 commit into
PowerShell:masterPowerShell/PSReadLine:masterfrom
daxian-dbw:empty-queuedaxian-dbw/PSReadLine:empty-queueCopy head branch name to clipboard
Mar 21, 2023
Merged

Make PSReadLine script hidden from debugger#3629
andyleejordan merged 1 commit into
PowerShell:masterPowerShell/PSReadLine:masterfrom
daxian-dbw:empty-queuedaxian-dbw/PSReadLine:empty-queueCopy head branch name to clipboard

Conversation

@daxian-dbw

@daxian-dbw daxian-dbw commented Mar 21, 2023

Copy link
Copy Markdown
Member

PR Summary

Fix #3260

PowerShell has a handler for Ctrl+Break, to break into debugger on the currently running script. This makes it possible to cause debugger to stop on the script that PSReadLine is running internally while it's idle (not processing any input keys). For example, it may be triggering the pulse pipeline for event processing by running the script "0", and Ctrl+Break causes the debugger to break in the script and pause the execution.

When this happens, a nested prompt will be provided to the user, which calls PSReadLine again to process input, which causes the re-entry of PSReadLine and make it crash.

The fix is to make the internal PSReadLine script hidden from PowerShell debugger, just like the built-in functions in PowerShell, such as prompt. Then Ctrl+Break won't cause debugger to interrupt the script execution in PSReadLine.

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
  • 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

@andyleejordan andyleejordan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh, clever Dongbo!

@andyleejordan andyleejordan merged commit 8485855 into PowerShell:master Mar 21, 2023
@daxian-dbw daxian-dbw deleted the empty-queue branch March 21, 2023 20:39
@ghost

ghost commented May 3, 2023

Copy link
Copy Markdown

🎉 v2.3.1-beta1 has been released which incorporates this pull request. 🎉

andyleejordan added a commit to PowerShell/PowerShellEditorServices that referenced this pull request May 12, 2023
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.

Exception thrown when stopping a stuck git log session with Alt+Pause

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.