Skip to content
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

After eval with F8, PSReadLine prompt appears in command output #3685

Closed
5 tasks
SeeminglyScience opened this issue Nov 10, 2021 · 5 comments · Fixed by PowerShell/PowerShellEditorServices#1690
Assignees
Labels
Area-Extension Terminal Area-PSReadLine Bug: Pre-release Bugs reproducing only in the pre-release extension. Issue-Bug A bug to squash.

Comments

@SeeminglyScience
Copy link
Collaborator

SeeminglyScience commented Nov 10, 2021

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.

Summary

When press F8, the prompt and PSReadLine repl area should appear after command input. Currently it does not rerender after command completion, and retains it's position.

This makes me think we are not cancelling the call to PSConsoleReadLine.ReadLine but are instead just taking it over via the delegate. The call needs to be actually cancelled before invocation and then restarted after invocation. The old code for this shows how to do this while still preserving the current repl input.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.2.0-preview.10
PSEdition                      Core
GitCommitId                    7.2.0-preview.10
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

1.61.0
ee8c7def80afc00dd6e593ef12f37756d8f504ea
x64

Extension Version

justin-grote.better-powershell-syntax-highlighting@0.0.2
ms-vscode.powershell@2021.10.2
ms-vscode.powershell-preview@2021.11.0

Steps to Reproduce

  1. Open untitled editor pane with language set to PowerShell
  2. Type Get-ChildItem
  3. Press F8
  4. Move focus to integrated console
  5. Type some stuff, hit enter, etc

Visuals

image

Logs

N/A

@SeeminglyScience SeeminglyScience added the Issue-Bug A bug to squash. label Nov 10, 2021
@ghost ghost added the Needs: Triage Maintainer attention needed! label Nov 10, 2021
@JustinGrote
Copy link
Collaborator

In my case it appears "prior" to the code running, probably a race condition or unawaited async involved here.

@StevenBucher98
Copy link
Contributor

Thanks for the information on this one! @SeeminglyScience We marked as bug and will work to fix

@StevenBucher98 StevenBucher98 added Area-PSReadLine Area-Extension Terminal Bug: Pre-release Bugs reproducing only in the pre-release extension. and removed Needs: Triage Maintainer attention needed! labels Nov 16, 2021
@andyleejordan
Copy link
Member

@SeeminglyScience Could you point me toward that "old code" and where in the new code you think this could be fixed?

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Jan 11, 2022
@andyleejordan
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Extension Terminal Area-PSReadLine Bug: Pre-release Bugs reproducing only in the pre-release extension. Issue-Bug A bug to squash.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants