Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_char: Handle non-tty terminals explicitly #124

Merged

Commits on May 7, 2022

  1. read_char: Handle non-tty terminals explicitly

    `Key::Unknown` is produced only when:
    - A keycode is not recognized by the `key_from_key_code` function under Windows
    - `read_key` is invoked on a non-tty terminal
    
    The two places in the code which explicitly handled `Key::Unknown` were
    treating it as a proxy for an "unattended terminal" check. Since this is
    only 100% valid to do when running under *nix I've replaced these
    handlers with an explicit `!self.is_tty` check instead, which is a common
    pattern in the Term code.
    
    `Key::Unknown` is now assumed to represent an unprintable / control key
    and skipped when being evaluated.
    deadalusai committed May 7, 2022
    Copy the full SHA
    497ea85 View commit details
    Browse the repository at this point in the history