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

Make fish_key_reader's output simpler #8467

Merged
merged 3 commits into from
Nov 22, 2021
Merged

Conversation

faho
Copy link
Member

@faho faho commented Nov 21, 2021

Description

fish_key_reader is mostly used to tell people how to bind a certain key combination.

However, by default it prints a lot of information that isn't useful for that and might be overwhelming:

> fish_key_reader
Press a key:
              hex:   1B  char: \c[  (or \e)
(  0.032 ms)  hex:   5B  char: [
(  0.023 ms)  hex:   31  char: 1
(  0.025 ms)  hex:   3B  char: ;
(  0.029 ms)  hex:   35  char: 5
(  0.031 ms)  hex:   41  char: A
bind \e\[1\;5A 'do something'

Really, everything I need here is the first line to tell me what to do, and the last line to tell me the information I was looking for.

Everything in between is useful for debugging, but doesn't need to be the default.

So this relegates all the timing and per-character information to a "--verbose" mode, the default output is just the bind command and instructions.

The new output looks like:

Press a key:
bind \e\[1\;5A 'do something'

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

It now only prints the bind statement. Timing information and such is
relegated to a separate "verbose" mode.
@faho faho merged commit f2fd30d into fish-shell:master Nov 22, 2021
@faho faho deleted the key_reader_simpler branch November 22, 2021 16:23
@faho faho added this to the fish 3.4.0 milestone Nov 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant