-
Notifications
You must be signed in to change notification settings - Fork 498
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
Integrated console hangs if PSReadline sets AddToHistoryHandler #2246
Comments
@jhoneill thanks for opening this and providing detailed information, we were able to reproduce this issue and will investigate the root cause...thanks! |
FWIW: Building both PSES and vscode-powershell from source based on the master branch doesn't appear to have this issue. |
It's probably non-deterministic, but the issue lies with trying to make PSReadLine work in a world where the prompt doesn't stop processing. The fix will lie in ensuring the scriptblock is run on the pipeline thread. |
Thinking about this, we may need to override However that's rather complex, so I'm not going to attempt it immediately. Also, @daxian-dbw might have a better idea here. |
@jhoneill I'm not sure about what causes the deadlock, but maybe a good news is that with the latest version of PSReadLine, you don't need leeholmes workaround to filter out the sensitive commands, it's built-in now :) |
Hey @jhoneill, we just released v2022.4.0-preview! Could you please try PowerShell Preview for VS Code and verify this is fixed? |
@andschwa In the current version this problem has gone away. Obvious it's been around for a while and I haven't kept checking it so I can't say if it was a recent change that fixed it but this can be closed now. |
I'm running preview but I think this may be in the release as well.
psreadline can save your passwords to its plaintext log. To prevent this leeholmes put out a little fragment
I found this was hanging my Intergrated console (but not a PowerShell terminal) in VS Code.
easy to repro
ensure you have the integrated console selected.
Run a command.
paste in
Set-PSReadLineOption -AddToHistoryHandler {param([string]$line) return $true}
Re-run the previous command
This may be a psreadline bug but it only occurs in the integrated console.
The text was updated successfully, but these errors were encountered: