Skip to content

Make fish_key_reader's output simpler#8467

Merged
faho merged 3 commits into
fish-shell:masterfrom
faho:key_reader_simpler
Nov 22, 2021
Merged

Make fish_key_reader's output simpler#8467
faho merged 3 commits into
fish-shell:masterfrom
faho:key_reader_simpler

Conversation

@faho
Copy link
Copy Markdown
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

faho added 3 commits November 21, 2021 11:11
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.

1 participant