Skip to content

Integrated console hangs if PSReadline sets AddToHistoryHandler #2246

Closed
@jhoneill

Description

@jhoneill

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

        Set-PSReadLineOption -AddToHistoryHandler {
            param([string]$line)
            $sensitive = "password|asplaintext|token|key|secret"
            return ($line -notmatch $sensitive)
        }

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions