Fix disappearing output in PowerShell 5.1#2023
Merged
andyleejordan merged 6 commits intomainfrom May 12, 2023
Merged
Conversation
Instead of every symbol reference lookup. Though we should probably still do this less often, like in the `prompt`.
Same fix as applied in PowerShell/PSReadLine#3629
The previous logic could accidentally set the boolean flag to `true`, causing the pipeline to be run when it was not necessary.
Since it doesn't change and we're always using it.
What a bug! In PowerShell 5.1 our artificial pipeline for event handling (among other possible PowerShell tasks) could cause the output to just disappear. Turns out a bug in 5.1 with the transcript was being triggered. Scripts without `Out-Default` would get it appended with `-TranscribeOnly True` in order for the transcription to happen...but the `TranscribeOnly` field could erroneously not be set back to `false`! This would cause all output to just "disappear." It was fixed in PowerShell 7, but we still have to work around it for PowerShell 5.1 by resetting it.
ce9d92d to
9d2a151
Compare
Member
Author
|
I half want to make this a bunch of PRs because it's quite a few fixes, oh well! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What a bug! In PowerShell 5.1 our artificial pipeline for event handling (among other possible PowerShell tasks) could cause the output to just disappear. Turns out a bug in 5.1 with the transcript was being triggered. Scripts without
Out-Defaultwould get it appended with-TranscribeOnly Truein order for the transcription to happen...but theTranscribeOnlyfield could erroneously not be set back tofalse! This would cause all output to just "disappear." It was fixed in PowerShell 7, but we still have to work around it for PowerShell 5.1 by resetting it.Resolves PowerShell/vscode-powershell#3991, and fixes a few other things too.
Unfortunately due to the implementation of PowerShell 5.1's transcript, we still get a flood of
[System.Diagnostics.DebuggerHidden()]param() 0in the transcript sometimes. It's annoying, and can lead to massive transcript files, but I don't believe it's the root cause. We're still looking for a way to fix that.