Skip to content

Display prompt after F8 finishes #1690

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

Merged
merged 3 commits into from
Feb 1, 2022
Merged

Conversation

andyleejordan
Copy link
Member

This fixes PowerShell/vscode-powershell#3685 by awaiting the task spawned by the evaluate handler (triggered by F8) and skipping the "next" prompt that actually should have been interrupted by that foreground task.

I believe this was the original intention, and indeed, debugging
shows that it is the correct behavior. On F8 we need to skip the
next prompt so the evaluated task runs instead, and then the
REPL correctly prompts after the evaluation is finished.
@andyleejordan
Copy link
Member Author

@SeeminglyScience Could you test this out? I'm trying to think of / find any unintended consequences, but it sure seems to have solved the problem.

@andyleejordan
Copy link
Member Author

Ditto @JustinGrote

@andyleejordan
Copy link
Member Author

@SeeminglyScience Have you had a chance to look at this?

@SeeminglyScience
Copy link
Collaborator

I haven't gotten a chance to test myself yet. I'm inclined to say this will be fine though and was just an oversight. I believe previously we were purposefully not waiting for completion but I don't think the architecture requires it anymore.

One thing I'd check is that F8ing $psEditor.GetEditorContext() doesn't dead lock. That would be my main concern

@andyleejordan
Copy link
Member Author

I haven't gotten a chance to test myself yet. I'm inclined to say this will be fine though and was just an oversight. I believe previously we were purposefully not waiting for completion but I don't think the architecture requires it anymore.

One thing I'd check is that F8ing $psEditor.GetEditorContext() doesn't dead lock. That would be my main concern

I couldn't get it to deadlock 👌

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

After eval with F8, PSReadLine prompt appears in command output
2 participants