Skip to content

[DBG] prompt not displayed when breakpoint hit unless Enter is pressed #1850

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 6, 2019 · 11 comments · Fixed by PowerShell/PowerShellEditorServices#1097

Comments

@sba923
Copy link

sba923 commented Apr 6, 2019

Issue Description

When I debug a PowerShell script and hit a breakpoint, the [DBG] prompt is not displayed immediately, but only after I hit Enter.

Here's what the TERMINAL pane shows when I hit F5 and the first breakpoint is hit:

[… output from various profile scripts]
PS ~/powershell> s:\powershell\df.ps1

When I then hit Enter this changes to:

[… output from various profile scripts]
PS ~/powershell> s:\powershell\df.ps1
[DBG]: PS ~/powershell>

Expected Behaviour

When the breakpoint is hit, the [DBG] prompt should be displayed right away.

Actual Behaviour

The [DBG] prompt is not displayed unless Enter is pressed.

Attached Log

PSESlogs201904060747.zip
s

System Details

System Details Output

### VSCode version: 1.33.0 0dd516dd412d42323fc3464531b1c715d51c4c1a x64

### VSCode extensions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]


### PSES version: 2.0.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.17763.316
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.316
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
@sba923
Copy link
Author

sba923 commented Apr 8, 2019

This might or might not be related to the following other issue with prompts:

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.

Both are incorrect if you ask me. I'll probably open a separate issue for that.

@SydneyhSmith
Copy link
Collaborator

@sba923 thanks for reporting, both of these issues, the second one does separate, could you please open another issue for that one? We can reproduce this, it looks related to PSReadLine support.
We are having trouble reproducing the first one...which launch configuration are you using?

@sba923
Copy link
Author

sba923 commented Apr 10, 2019

You're welcome.

Opened #1862.

(I've already mentioned which launch configurations I'm using ;-) )

@sba923
Copy link
Author

sba923 commented Nov 4, 2019

I hate to say, but I can repro this with version 2019.11.0 of the PowerShell Preview extension (in conjunction with PSReadLine 2.0.0 beta 5).

I get an additional issue when I hit Enter after the debugger stops at the breakpoint:

image

I will open a new issue for that.

@rjmholt
Copy link
Contributor

rjmholt commented Nov 4, 2019

I hate to say, but I can repro this with version 2019.11.0 of the PowerShell Preview extension

Yes, this issue remains open because we haven't been able to address it yet.

@sba923
Copy link
Author

sba923 commented Nov 5, 2019

You're right. I should've inferred that from the release notes....

@TylerLeonhardt TylerLeonhardt removed the Needs: Maintainer Attention Maintainer attention needed! label Nov 5, 2019
@rjmholt
Copy link
Contributor

rjmholt commented Nov 5, 2019

I looked into this a little bit, but I wasn't able to track down where it happens yet. Given that the workaround is to press enter, I'll have to get back to this one while we solve some of the other issues in the latest preview.

@TylerLeonhardt
Copy link
Member

I have a fix out for this ^

@sba923
Copy link
Author

sba923 commented Nov 10, 2019

Great! Want me to give it a shot?

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Nov 10, 2019
@TylerLeonhardt
Copy link
Member

@sba923

Keep in mind this is a non-signed non-supported build and only for the sake of verifying that the problem is fixed.

PowerShell-insiders.vsix.zip

Here's the vsix - do you know have to install it?

code --install-extension path/to/vsix

or
in the GUI on the extensions page.

You may need to uninstall the PowerShell Preview extension in order to install this one as I have not rev'd the version.

@TylerLeonhardt TylerLeonhardt removed the Needs: Maintainer Attention Maintainer attention needed! label Nov 12, 2019
@sba923
Copy link
Author

sba923 commented Nov 12, 2019

@TylerLeonhardt I hereby confirm that the fix worked on first try. Great job!

(I was scared at first by the "the extension has been updated to..." notification, fearing that the marketplace version might have overwritten the one from the VSIX...)

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Nov 12, 2019
@rjmholt rjmholt removed the Needs: Maintainer Attention Maintainer attention needed! label Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants