mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
Update fish_key_reader docs
* Document all options * Document bind command output * Remove session output - it's enough to explain how one exits.
This commit is contained in:
parent
497b3f51c8
commit
417d53a58f
1 changed files with 7 additions and 27 deletions
|
@ -2,39 +2,19 @@
|
|||
|
||||
\subsection fish_key_reader-synopsis Synopsis
|
||||
\fish{synopsis}
|
||||
fish_key_reader [-c | --continuous]
|
||||
fish_key_reader [-c | --continuous] [-d | --debug-level] [-D | --debug-stack-frames]
|
||||
\endfish
|
||||
|
||||
\subsection fish_key_reader-description Description
|
||||
|
||||
`fish_key_reader` is used to show in a human friendly manner the sequence of characters each key on a keyboard sends. If the sequence of characters matches a key name recognized by the `bind` command that is also displayed. It shows each characters decimal, hexadecimal and symbolic values. It also shows the delay in microseconds since the previous character was received. The timing data is useful for detecting when an intermediary such as ssh or tmux has altered the timing of the characters sent by the keyboard. If at least 0.2 seconds has passed since the previous character the program will insert a blank line in the output. This makes it visually easier to distinguish the sequence of chars sent by a single key press.
|
||||
`fish_key_reader` can be used to interrogate the characters received by `fish` and figure out key binds. If the sequence of characters matches a key name recognized by the `bind` command, `bind`'s representation will be shown. Also output are decimal, hexadecimal and symbolic values of the character and the delay in milliseconds since the previous character was received.
|
||||
|
||||
By default the program exits after displaying a single key sequence. Specifially, it exits after 0.5 seconds has elapsed without seeing another character after the first character is seen. You can force it to run in a continuous mode by passing the `--continuous` or `-c` flag.
|
||||
Before exiting, the tool will output an example bind command which matches the sequence captured.
|
||||
|
||||
Here is an example of the program in action that also shows how to exit from continuous mode:
|
||||
The timing data may be useful to determine a preferred `fish_escape_delay_ms` setting or learning the amount of lag introduced by `ssh` or `tmux`.
|
||||
|
||||
```
|
||||
$ ./fish_key_reader --continuous
|
||||
- `-c` or `--continuous` begins a session where mutlitple key sequences can be inspected. By default the program exits after capturing a single key sequence. Press `^D` twice or type `exit` to exit.
|
||||
|
||||
Type 'exit' or 'quit' to terminate this program.
|
||||
- `-d` or `--debug-level=DEBUG_LEVEL` enables debug output and specifies a verbosity level. Like `fish -d`.
|
||||
|
||||
Characters such as [ctrl-D] (EOF) and [ctrl-C] (interrupt)
|
||||
have no special meaning and will not terminate this program.
|
||||
|
||||
Type 'exit' or 'quit' to terminate this program.
|
||||
|
||||
999999 usec dec: 27 hex: 1b char: \e (aka \c[)
|
||||
450 usec dec: 91 hex: 5b char: [
|
||||
409 usec dec: 49 hex: 31 char: 1
|
||||
424 usec dec: 126 hex: 7e char: ~
|
||||
FYI: Found sequence for bind key name "home"
|
||||
|
||||
Type 'exit' or 'quit' to terminate this program.
|
||||
|
||||
999999 usec dec: 113 hex: 71 char: q
|
||||
111562 usec dec: 117 hex: 75 char: u
|
||||
55820 usec dec: 105 hex: 69 char: i
|
||||
128021 usec dec: 116 hex: 74 char: t
|
||||
|
||||
Exiting at your request.
|
||||
```
|
||||
- `-D` or `--debug-stack-frames=DEBUG_LEVEL` specifies how many stack frames to display when debug messages are written. The default is zero.
|
Loading…
Reference in a new issue