question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After eval with F8, PSReadLine prompt appears in command output

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
StevenBucher98commented, Nov 16, 2021

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

1reaction
JustinGrotecommented, Nov 12, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found