Skip to content

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

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

Closed
sba923 opened this issue Apr 10, 2019 · 9 comments
Closed

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

sba923 opened this issue Apr 10, 2019 · 9 comments
Labels

Comments

@sba923
Copy link

sba923 commented Apr 10, 2019

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

@PrzemyslawKlys
Copy link
Contributor

PrzemyslawKlys commented Apr 10, 2019

Are you using PSReadLine? #1727

@sba923
Copy link
Author

sba923 commented Apr 10, 2019

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

@PrzemyslawKlys
Copy link
Contributor

Yes, thats why I disabled PSReadline.

@SydneyhSmith
Copy link
Collaborator

Thanks for opening @sba923

@sba923
Copy link
Author

sba923 commented Apr 10, 2019

Yes, thats why I disabled PSReadline.

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

@PrzemyslawKlys
Copy link
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 :-)

@sba923
Copy link
Author

sba923 commented Apr 10, 2019

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!

@PrzemyslawKlys
Copy link
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 :-)

@SydneyhSmith SydneyhSmith added the Resolution-Fixed Will close automatically. label Jan 30, 2020
@SydneyhSmith
Copy link
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
Labels
Projects
None yet
Development

No branches or pull requests

4 participants