mirror of
https://github.com/nushell/nushell
synced 2024-11-16 01:37:57 +00:00
8501024546
Supercedes https://github.com/nushell/nushell/pull/10196 # Description After reading https://github.com/nushell/nushell/pull/10196#issuecomment-1703986359 I added a signpost from `keybindings listen` to `input listen` When I initially tried `input listen` it always immediately returned with: ``` ╭───────┬────────╮ │ type │ focus │ │ event │ gained │ ╰───────┴────────╯ ``` I added an example to `input listen --help` to suggest only listening to key events Initially I also included a `result` but it prints as: ``` ╭───────────┬───────────────╮ │ type │ key │ │ key_type │ char │ │ code │ c │ │ modifiers │ [list 1 item] │ ╰───────────┴───────────────╯ ``` rather than: ``` ╭───────────┬───────────────────────────────╮ │ type │ key │ │ key_type │ char │ │ code │ c │ │ │ ╭───┬───────────────────────╮ │ │ modifiers │ │ 0 │ keymodifiers(control) │ │ │ │ ╰───┴───────────────────────╯ │ ╰───────────┴───────────────────────────────╯ ``` so I removed it. # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> * Example describing how to use `input list --types [key]` to listen for keybindings. * Signpost pointing at `use std input; input list --types [key]` from `keybindings list`. ## After merging It is probably worth: a) signposting to the keybindings section of the book from both of these subcommands (like I did in https://github.com/nushell/nushell/pull/10193), b) giving an example in the book of how to take the output from `input listen --types [key]` and format it for including in `config nu` c) there are not currently any examples in crates/nu-utils/src/sample_config/default_config.nu for keybindings with multiple modifiers. Should I add alt+backspace-in-macos-vscode as an example (gets translated to `{ modifier: control_alt keycode: char_h }` for historical reasons)? --------- Co-authored-by: Antoine Stevan <44101798+amtoine@users.noreply.github.com> |
||
---|---|---|
.. | ||
src | ||
tests | ||
Cargo.toml | ||
LICENSE |