Skip to content

TextMenu - clear console's buffer before read #35

@lastunicorn

Description

@lastunicorn

Before reading the user's input, clear the console buffer.

If it is not cleared, the user may type keys before the menu is displayed. The menu may execute some item that the user didn't intended.

This code might help:

while (Console.KeyAvailable)
    Console.ReadKey(true);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions