After eval with F8, PSReadLine prompt appears in command output
See original GitHub issuePrerequisites
- 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
- 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
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Set-PSReadLineOption (PSReadLine) - PowerShell
Customizes the behavior of command line editing in PSReadLine. ... lines to be available when PSReadLine displays the prompt after showing some output....
Read more >Changes.txt 2.0.1 - PowerShell Gallery
your prompt is non-trivial. To fix, use `Set-PSReadLineOption -PromptText "> "`. * Consistently use `PSReadLine` instead of `PSReadline` everywhere, APIs, ...
Read more >Chapter 1. PowerShell Language and Environment - O'Reilly
If this line doesn't contain any text that looks like a prompt, PowerShell adds a prompt ... OUTPUTS. A short summary of items...
Read more >Comparison of command shells - Wikipedia
A command shell is a command-line interface to interact with and manipulate a computer's operating system. Bash, the default shell on many GNU/Linux...
Read more >Doing More with PSReadline History -- Part 2
In this screen shot, I have a brand new PowerShell session with only two commands. When I press F8, I can go through...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the information on this one! @SeeminglyScience We marked as bug and will work to fix
In my case it appears “prior” to the code running, probably a race condition or unawaited async involved here.