Description
When canceling the ReadKey
method sent to PSReadLine, we observed that there's a race where PSReadLine is still consuming (and using) the dummy character we're returning when the method is canceled:
While the chosen dummy character should be a no-op, as observed in PowerShell/vscode-powershell#3225 (comment) it can come through as an à
and in PowerShell/vscode-powershell#3881 (comment) it comes through as an "
.
@daxian-dbw, @SeeminglyScience and I discovered this when trying to just use default
for the returned value, and we think that around here "PSRL is probably checking if key returned, then checking if cancelled. Meaning if we have a key it doesn't check if cancelled."