Repository navigation
Closed
PowerShell/PowerShellEditorServices
#1690Labels
Area-Extension TerminalArea-PSReadLineBug: Pre-releaseBugs reproducing only in the pre-release extension.Issue-BugA bug to squash.
Milestone
Description
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.0Visual Studio Code Version
1.61.0
ee8c7def80afc00dd6e593ef12f37756d8f504ea
x64Extension Version
Steps to Reproduce
- Open untitled editor pane with language set to PowerShell
- Type Get-ChildItem
- Press F8
- Move focus to integrated console
- Type some stuff, hit enter, etc
Visuals
Logs
N/A
Reacted by ili101, Niklas Goebel and Andy Jordan
Reacted by Andy Jordan and Jay Cap
Metadata
Metadata
Assignees
Labels
Area-Extension TerminalArea-PSReadLineBug: Pre-releaseBugs reproducing only in the pre-release extension.Issue-BugA bug to squash.
Type
Projects
- StatusShow more project fieldsDone

Activity
JustinGrote commentedon Nov 12, 2021
In my case it appears "prior" to the code running, probably a race condition or unawaited async involved here.
StevenBucher98 commentedon Nov 16, 2021
Thanks for the information on this one! Patrick Meinecke (@SeeminglyScience) We marked as bug and will work to fix
andyleejordan commentedon Jan 6, 2022
Patrick Meinecke (@SeeminglyScience) Could you point me toward that "old code" and where in the new code you think this could be fixed?
SeeminglyScience commentedon Jan 11, 2022
Andy Jordan (@andschwa) sorry for the delay
Old code:
https://github.com/PowerShell/PowerShellEditorServices/blob/6b1e77d6223ff61c4af3cbeedf687e1f65f3ac18/src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs#L612-L649
New code probably around here:
https://github.com/PowerShell/PowerShellEditorServices/blob/99b523ef9fb6b3894a71291182a42ab280584eb9/src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs#L263-L266
andyleejordan commentedon Jan 11, 2022
Thanks!