Skip to content

Console.KeyAvailable echoes typed key on Linux and macOS #20295

@daviwil

Description

@daviwil

I've been using Console.KeyAvailable to implement an async ReadKey method that waits until a key is available before calling Console.ReadKey(true). This has been working well on Windows but it breaks down on *NIX because the Console.KeyAvailable property causes the typed key to be echoed. This happens before I have a chance to call ReadKey specifying that I don't want it to echo the typed key.

Is this a bug? If not, is there some way I can tell the console implementation to not echo keys when KeyAvailable is used?

/cc @stephentoub

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions