-
Notifications
You must be signed in to change notification settings - Fork 223
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
Fix debugging output location #1162
Fix debugging output location #1162
Conversation
Big thanks for @daxian-dbw for helping me out! |
I'd recommend manually testing as many scenarios as you can with this one. Aborting PSRL without actually stopping it in the host could lead to a race condition where PSRL starts again before this thread actually acquires a runspace handle |
@SeeminglyScience calling |
Unfortunately yeah :/ Here's the relevant bits in the host. Those methods are called in the |
Can we just lock it out? I know that means needing to acquire another lock for every prompt, but that's the cost of parallelism. All we need to know is where we should yield the lock. I assume that's after the |
It's not impossible, but with how it's set up it would be challenging. You'd have better luck moving the |
That last commit gets rid of:
I'm not sure where my prompt goes though... |
If both WriteOutput and Starting the REPL relied on having lock access to the runspace, could that work, @SeeminglyScience? |
Just add a new internal property to Lines 681 to 684 in 3b890c3
Change it to: if (executionOptions.WriteInputToHost)
{
this.WriteOutput(
executionOptions.CommandText ?? psCommand.Commands[0].CommandText,
true);
} |
Ok I think I'm crazy... but we don't need the |
Yessir that's right |
Ok, I think this is ready for a proper review @SeeminglyScience |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! with one nit
This fixes a lot of the prompt/output issues that we've been seeing.
fixes PowerShell/vscode-powershell#2372
fixes PowerShell/vscode-powershell#2407
fixes PowerShell/vscode-powershell#2408
this.WriteOutput
when insteadExecuteCommandAsync
could just do itWriteOutput
in the finally block now only runs in the legacy readline experienceThere's still a weird thing happening with prompts on F5... but that existed before this change so I'll try to address that in another PR.