Skip to content

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

Closed
PowerShell/PowerShellEditorServices
#1097

Description

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

Activity

  1. sba923 commented on Apr 8, 2019

    @sba923
    Author

    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.

  2. SydneyhSmith commented on Apr 9, 2019

    @SydneyhSmith
    Collaborator

    Stéphane BARIZIEN (@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?

  3. sba923 commented on Apr 10, 2019

    @sba923
    Author

    You're welcome.

    Opened #1862.

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

  4. sba923 commented on Nov 4, 2019

    @sba923
    Author

    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.

  5. ghost added
    Needs: Maintainer Attention
    on Nov 4, 2019
  6. rjmholt commented on Nov 4, 2019

    @rjmholt
    Contributor

    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.

  7. sba923 commented on Nov 5, 2019

    @sba923
    Author

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

  8. removed
    Needs: Maintainer Attention
    on Nov 5, 2019
  9. rjmholt commented on Nov 5, 2019

    @rjmholt
    Contributor

    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.

  10. TylerLeonhardt commented on Nov 10, 2019

    @TylerLeonhardt
    Member

    I have a fix out for this ^

  11. sba923 commented on Nov 10, 2019

    @sba923
    Author

    Great! Want me to give it a shot?

  12. ghost added
    Needs: Maintainer Attention
    on Nov 10, 2019
  13. TylerLeonhardt commented on Nov 12, 2019

    @TylerLeonhardt
    Member

    Stéphane BARIZIEN (@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.

  14. sba923 commented on Nov 12, 2019

    @sba923
    Author

    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...)

  15. ghost added
    Needs: Maintainer Attention
    on Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions