Skip to content

Script output gets mixed up with prompt when run under debugger #1862

Closed

Description

Issue Description

Take the following script, stored at C:\private_sba\PowerShell\TestPowerShellDebuggerBehaviorWithPrompt.ps1:

Write-Host("WH1")
Write-Host("WH2")
Write-Host("WH3")

If you run this via F5 in the Windows PowerShell ISE you get:

PS ~> C:\private_sba\PowerShell\TestPowerShellDebuggerBehaviorWithPrompt.ps1
WH1
WH2
WH3

But if you do the same in VScode, you get:

PS ~/PowerShell/work> WH1private_sba\PowerShell\TestPowerShellDebuggerBehaviorWithPrompt.ps1
WH2
WH3

if you're using the "PowerShell Launch Current File" configuration, and

PS ~/PowerShell/work> c:\private_sba\PowerShell\TestPowerShellDebuggerBehaviorWithPrompt.ps1

                      WH1
WH2
WH3

if you're using the "PowerShell Launch Current File w/Args Prompt" configuration.

Expected Behaviour

The script's output should be displayed after / below the prompt + name of script being debugged.

Actual Behaviour

The script's output is intermingled with the prompt / name of the script being debugged.

Attached Logs

PSES_logs_201904101012.zip

System Details

System Details Output

Activity

  1. PrzemyslawKlys commented on Apr 10, 2019

    @PrzemyslawKlys
    Contributor

    Are you using PSReadLine? #1727

  2. sba923 commented on Apr 10, 2019

    @sba923
    Author

    Yes I am. Debugging a PowerShell script under VScode when you have no history at the [DBG] prompt is pretty impossible if you ask me ;-)

    See also #1850

  3. PrzemyslawKlys commented on Apr 10, 2019

    @PrzemyslawKlys
    Contributor

    Yes, thats why I disabled PSReadline.

  4. SydneyhSmith commented on Apr 10, 2019

    @SydneyhSmith
    Collaborator

    Thanks for opening Stéphane BARIZIEN (@sba923)

  5. sba923 commented on Apr 10, 2019

    @sba923
    Author

    Yes, thats why I disabled PSReadline.

    Przemysław Kłys (@PrzemyslawKlys): you got me wrong; I meant that one cannot (decently) debug under VScode without PSReadline

  6. PrzemyslawKlys commented on Apr 10, 2019

    @PrzemyslawKlys
    Contributor

    I see, well I am not that experienced in debugging. I am pressing F5, stop and check what's there and try again, and again :-)

  7. sba923 commented on Apr 10, 2019

    @sba923
    Author

    Sure, but when you're at the [DBG] prompt, you typically want to look at multiple things one after another, so you need up/down arrow command history to run the same commands (e.g. to evaluate an expression) over and over again!

  8. PrzemyslawKlys commented on Apr 10, 2019

    @PrzemyslawKlys
    Contributor

    Right now, when I touch any code while in debug (like trying to fix code when stopped VSCode crashes). Not sure why I would need to evaluate expression over and over but it may be I'm just too weak :-)

  9. SydneyhSmith commented on Jan 30, 2020

    @SydneyhSmith
    Collaborator

    Marking as fixed as the PR for this has been merged...should be available in the next update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-DebuggingArea-PSReadLineIssue-BugResolution-Fixed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions