System Details Output
### VSCode version: 1.46.1 cd9ea6488829f560dc949a8b2fb789f3cdc05f5d 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]
[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]
[email protected]
[email protected]
[email protected]
[email protected]
### PSES version: 2.2.0.0
### PowerShell version:
Name Value
---- -----
PSVersion 7.1.0-preview.3
PSEdition Core
GitCommitId 7.1.0-preview.3
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0鈥
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
The interactive debugging experience appears to be completely broken. These probably could be separate issues, so feel free to split them out, but they're all ultimately related and I really just want to fix the issue I'm currently trying to debug more than I really wanna spend hours debugging the issues in the extension I'm currently butting heads with.
Sincere apologies in advance in case my current frustration colours any of this, I've tried to be as detailed as I can manage at the moment, but ultimately I'm trying to debug an issue in my own code, so it's been a bit frustrating running into issues with the extension at the same time, especially for configurations that previously worked very intuitively and now don't seem to work at all.
Did a bit of poking around and realized what the underlying issue is here. These two settings don't work together:
PowerShell > Debugging: Create Temporary Integrated Console(ON)PowerShell > Integrated Console: Show on Startup(OFF)If you have this configuration, whenever you try to start a debugging session, the _wrong console_ is exposed and focused -- the main integrated console is shown instead of the new temporary console. As a result, nothing seems to work, because the extension is still managing the debug session from the temporary session instead of the one it's actually showing.
/cc @rjmholt @TylerLeonhardt
Things I have tried:
PowerShell Interactive Session or PowerShell Attach Interactive Session Runspace default debug configurationsThe issue here seems to be that breakpoints are completely ignored. I can run commands in the interactive console, but no breakpoints I set in the VS Code UI are ever hit. For full clarity, I'm setting breakpoints in the files for my module functions, then importing the module in the interactive console and trying to run commands and hit the breakpoints from there.
To my memory, this did used to work somewhere around a few months back without an issue.
PowerShell Attach to Host Process to attach to another Pwsh console and running commands in thereThis is so far the best experience I've had recently and it's still very broken. Breakpoints are hit and I can step through easily, this is nice. However, in the Variable view pane in the sidebar, complex objects other than dictionary types like hashtables are apparently serialized to string, so all I can see is the type name and none of the property information, so I have _very_ limited visibility as to what's actually going on.
PowerShell Launch Current File / PowerShell Launch Script configurationsThis seems to work most consistently and works fairly well, but in a lot of cases I want to be debugging my module functions, so I need to put all the commands I want to try out in a new file, which makes for (imo) a very clunky debugging experience, as I need to restart the debug session every time I want to try something else.
To remedy this, I tried to add a $host.EnterNestedPrompt() to the script to let me drop into the interactive console and work from there, running module commands myself so I can debug from there. The extension seems to be running all debugging in a background runspace rather than the "Integrated" console (so... it's _not_ Integrated to a useful degree at all anymore, apparently!) and so the EnterNestedPrompt() call simply pauses execution with no possible way to resume it. No prompt is shown in the interactive console, so I can only conclude it's not running in the main integrated console runspace, which makes things very unintuitive.
Additionally, in this mode I don't get _any_ output in the Integrated Console, which is usually still useful even when debugging. Not sure when _that_ changed but it makes the debugging experience feel significantly more "flying blind" than I would like, it's more obtuse than littering my code with Write-Host (which I really hate to do, but would feel more intuitive than this experience currently does).
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "PowerShell Launch Script",
"type": "PowerShell",
"request": "launch",
"script": "./Start-DebugSession.ps1",
"cwd": "${workspaceFolder}"
},
{
"name": "PowerShell: Launch Current File",
"type": "PowerShell",
"request": "launch",
"script": "${file}",
"cwd": "${file}"
},
{
"name": "PowerShell Interactive Session",
"type": "PowerShell",
"request": "launch",
"cwd": ""
},
{
"name": "PowerShell Attach Interactive Session Runspace",
"type": "PowerShell",
"request": "attach",
"processId": "current"
},
{
"name": "PowerShell Attach to Host Process",
"type": "PowerShell",
"request": "attach",
"runspaceId": 1
}
]
}
Thanks @vexx32 really appreciate you opening this issue and being do detailed, unfortunately we were not able to reproduce interactive debugging not functioning properly so as you mentioned logs would be very helpful--instructions for how to do that are here
Did a bit of poking around and realized what the underlying issue is here. These two settings don't work together:
PowerShell > Debugging: Create Temporary Integrated Console (ON)PowerShell > Integrated Console: Show on Startup (OFF)If you have this configuration, whenever you try to start a debugging session, the _wrong console_ is exposed and focused -- the main integrated console is shown instead of the new temporary console. As a result, nothing seems to work, because the extension is still managing the debug session from the temporary session instead of the one it's actually showing.
This... explains a _lot_. 馃槀
Hmmm, I think we've discussed both the settings and the implementation for the temp console, and I'd personally be happy to improve how it all works once other work is out of the way
Thanks, that'd be awesome! 馃挅
If it helps, logs from a quick run through of the problem are attached. 馃榿
1594159755-2a72e192-4b06-449d-821a-1f1042b763891594158464672.zip
EDIT: Updated the original issue post with the above info & logs as well so it's all in one place.