Skip to content

ReadKey does not honor NoEcho on OSX. #3183

Description

Steps to reproduce

Run the following and enter any printable character.

$host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")                                                                     

Expected behavior

Entered character is not echoed.

$host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")

VirtualKeyCode Character ControlKeyState KeyDown
-------------- --------- --------------- -------
            87         w               0    True

Above is from PS 5.1.14393.693 and v6.0.0-alpha.16 on Windows 10.

Actual behavior

Character is echoed.

$host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
w
VirtualKeyCode Character ControlKeyState KeyDown
-------------- --------- --------------- -------
            87         w               0    True

Environment data

Name                           Value                                                                                               
----                           -----                                                                                               
PSVersion                      6.0.0-alpha                                                                                         
PSEdition                      Core                                                                                                
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                             
BuildVersion                   3.0.0.0                                                                                             
GitCommitId                    v6.0.0-alpha.16                                                                                     
CLRVersion                                                                                                                         
WSManStackVersion              3.0                                                                                                 
PSRemotingProtocolVersion      2.3                                                                                                 
SerializationVersion           1.1.0.1 
PS /Users/thezim> sw_vers                                                                                                             
ProductName:	Mac OS X
ProductVersion:	10.12.3
BuildVersion:	16D32
PS /Users/thezim>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions