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

Fix disappearing output in PowerShell 5.1#2023

Merged
andyleejordan merged 6 commits into
mainPowerShell/PowerShellEditorServices:mainfrom
andschwa/fix-output-bugPowerShell/PowerShellEditorServices:andschwa/fix-output-bugCopy head branch name to clipboard
May 12, 2023
Merged

Fix disappearing output in PowerShell 5.1#2023
andyleejordan merged 6 commits into
mainPowerShell/PowerShellEditorServices:mainfrom
andschwa/fix-output-bugPowerShell/PowerShellEditorServices:andschwa/fix-output-bugCopy head branch name to clipboard

Conversation

@andyleejordan

@andyleejordan andyleejordan commented May 12, 2023

Copy link
Copy Markdown
Member

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.

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() 0 in 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.

Instead of every symbol reference lookup.
Though we should probably still do this less often, like in the `prompt`.
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.
@andyleejordan andyleejordan requested a review from a team May 12, 2023 19:15
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.
@andyleejordan andyleejordan force-pushed the andschwa/fix-output-bug branch from ce9d92d to 9d2a151 Compare May 12, 2023 19:19

@SeeminglyScience SeeminglyScience left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@andyleejordan

Copy link
Copy Markdown
Member Author

I half want to make this a bunch of PRs because it's quite a few fixes, oh well!

@andyleejordan andyleejordan merged commit 14f2be8 into main May 12, 2023
@andyleejordan andyleejordan deleted the andschwa/fix-output-bug branch May 12, 2023 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Write-Output broken

2 participants

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