vscode-powershell icon indicating copy to clipboard operation
vscode-powershell copied to clipboard

Interactive Session Debug "stops" after single command entry

Open JustinGrote opened this issue 2 years ago • 5 comments

Issue Type: Bug

Previously, if you started an Interactive Debug session with the following launch config:

      {
        "name": "PS: Interactive",
        "presentation": {
          "group": "Powershell"
        },
        "request": "launch",
        "type": "PowerShell"
      },

It would stay in debug mode until you explicitly cancelled it. For at least a couple previews, now if you hit enter in the PSIC, the debug "mode" will stop, however the breakpoints will still be there and not cleaned up, leading to confusing behavior.

Either clean up breakpoints or fix it so that issuing a command doesn't stop the debugger. I recommend for the latter as that was the previous behavior. Capture

Extension version: 2022.5.5 VS Code version: Code - Insiders 1.68.0-insider (ba2dd825803b5f95d5dcce927afc3a4882ed0f84, 2022-05-19T05:16:03.853Z) OS version: Windows_NT x64 10.0.22621 Restricted Mode: No Connection to 'SSH: hospicegroups' could not be established Canceled Remote OS version: Windows_NT x64 10.0.20348

System Info
Item Value
CPUs AMD Ryzen 7 4700U with Radeon Graphics (8 x 1996)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.36GB (1.88GB free)
Process Argv --crash-reporter-id 4453efaa-0821-4555-88e2-3de8bad9109e
Screen Reader no
VM 0%

Connection to 'SSH: hospicegroups' could not be established Canceled

Item Value
Remote SSH: hospicegroups
OS Windows_NT x64 10.0.20348
CPUs Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (4 x 2794)
Memory (System) 8.00GB (5.31GB free)
VM 0%
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
vscod805:30301674
pythonvspyt200:30323110
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30404738
wslgetstarted:30449409
pythonvsnew555:30438690
vscscmwlcmt:30465136
cppdebug:30492333
vsclangdf:30492506

JustinGrote avatar May 22 '22 03:05 JustinGrote

This is complicated. The reason it started happening is that we synced the state of the PowerShell debugger and the VS Code debugger. We did this by essentially checking on each REPL if the PowerShell debugger was still running; if not, we stop the VS Code debugger. This seems to be the edge case where that behavior is not wanted, so we need another condition, but it's a whole lot of complex state tracking.

andyleejordan avatar Jun 02 '22 22:06 andyleejordan

Ideally one day we'd just be able to sync breakpoints outside of debug sessions. Dunno if that day will ever come, but it sure would be ideal if "interactive debugging" was just the default.

SeeminglyScience avatar Jun 08 '22 18:06 SeeminglyScience

I think @SeeminglyScience is attempting to wire this up. Changing assignee.

andyleejordan avatar Jun 21 '22 18:06 andyleejordan

It is possible https://github.com/PowerShell/vscode-powershell/pull/4065 may resolve this, linking for posterity.

JustinGrote avatar Oct 27 '23 21:10 JustinGrote

Also to be clear this may need to be split into two issues:

  • Breakpoints not being cleaned up after debug stop
  • Debug stopping after first command is entered (this may need to become a setting toggle as people are at this point potentially used to the "new" behavior)

JustinGrote avatar Jan 17 '24 17:01 JustinGrote