-
Notifications
You must be signed in to change notification settings - Fork 503
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
'Safe handle has been closed' when stopping debugger while in a dynamicparam section in v2.2 #3751
Comments
The exception indicates that the |
Well, I can reproduce this, which is great, but not sure why the token is getting prematurely disposed. Working on it 🤷 |
@daxian-dbw I think this recurs when ReadLine is invoked in a nested manner. In this bug report's case, the dynamic parameter was being expanded by ReadLine, then the debugger is invoked and a new nested debug prompt opens up, invoking ReadLine a second time. I was also able to reproduce accidentally when working on another bug, and it was again when ReadLine was running and I called it a second time. Is this a supported scenario for ReadLine, if not, what's the best way to handle it? |
It's not a supported scenario. Is it possible to identify that we are re-entering the |
Yeah even debugging outside of VSCode seems to fall apart in this scenario. We may want to consider automatically resuming in this case, and suggest debugging these scenarios be done via attach to process. |
Hey @fsackur, I can no longer reproduce this with the latest preview, and we fixed some issues around when to display the prompt in PowerShell/PowerShellEditorServices#1690. Can you please verify that this no longer reproduces with v2022.2.0-preview? |
Marking as fixed, if it does still repro, please let me know, and re-open it! |
This issue has been marked as fixed. It has been automatically closed for housekeeping purposes. |
I do still see the issue in VS Code 1.64.2 with the PS Preview extension in the PS Integrated Terminal using PSv7.2.1:
However, in PSRL 2.2.1-rc1 in a "normal" terminal, I do not see the issue. |
This looks pretty broken in the stable extension too 😢 |
Unfortunately still repros with v2022.4.1-preview and with PowerShell/PowerShellEditorServices#1758, but next up is some serious work in PSReadLine. |
It'd be nice to have a better error message here, but this is still a case of needing re-entrance in PSReadLine. Now that attach to process works, I think that's the best way to debug argument completers, tab completion in general, and PSReadLine key handlers. |
Agreed. |
Prerequisites
Exception report
Screenshot
N/A
Environment data
Steps to reproduce
dynamicparam
block and start an interactive sessionfoo -
and hit <tab>dynamicparam
block, as expectedExpected behavior
No exception
Actual behavior
Error shown
The text was updated successfully, but these errors were encountered: