From 53961c775990591bab8897ae7f2b64a049dd5201 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Tue, 2 Apr 2024 17:39:39 +0200 Subject: [PATCH] Fix doc formatting This is RST, not markdown --- CHANGELOG.rst | 7 +++++-- doc_src/interactive.rst | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 603934c81..994dabd18 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -23,19 +23,22 @@ Notable backwards-incompatible changes - Fish now decodes keyboard input into human-readable key names. To make this for for a wide range of terminals, fish asks terminals to speak several keyboard protocols, - including CSI u, XTerm's ``modifyOtherKeys`` and some progressive enhancements from the [kitty keyboard protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol/). + including CSI u, XTerm's ``modifyOtherKeys`` and some progressive enhancements from the `kitty keyboard protocol `. Depending on terminal support, this allows to bind a lot more key combinations, including arbitrary combinations of modifiers ``ctrl``, ``alt`` and ``shift``. This comes with a new syntax for specifying keys to builtin ``bind``. The new syntax introduces modifier names and names for some keys that don't have an obvious and printable Unicode code point. The old syntax remains mostly supported but the new one is preferred. + - Existing bindings that use the new names have a different meaning now. For example + - ``bind up 'do something'`` binds the up arrow key instead of a two-key sequence. - ``bind ctrl-x,alt-c 'do something'`` binds a sequence of two keys. - Since ``,`` and ``-`` act as separators, there are some cases where they need to be written as ``comma`` and ``minus`` respectively. + Since ``,`` and ``-`` act as separators, there are some cases where they need to be written as ``comma`` and ``minus`` respectively. - To minimize gratuitous breakage, the key argument to ``bind`` is parsed using the old syntax in two cases: + - If key starts with a raw escape character (``\e``) or a raw ASCII control character (``\c``). - If key consists of exactly two characters, contains none of ``,`` or ``-`` and is not a named key. diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst index 03b4964dd..7621efabf 100644 --- a/doc_src/interactive.rst +++ b/doc_src/interactive.rst @@ -557,6 +557,8 @@ To find out the name of a key, you can use :doc:`fish_key_reader fish_key_reader # Press Alt + right-arrow Press a key: + bind alt-right 'do something' + Note that some key combinations are indistinguishable or unbindable. For instance control-i *is the same* as the tab key. This is a terminal limitation that fish can't do anything about. When ``fish_key_reader`` prints the same sequence for two different keys, then that is because your terminal sends the same sequence for them. Also, :kbd:`Escape` is the same thing as :kbd:`Alt` in a terminal. To distinguish between pressing :kbd:`Escape` and then another key, and pressing :kbd:`Alt` and that key (or an escape sequence the key sends), fish waits for a certain time after seeing an escape character. This is configurable via the :envvar:`fish_escape_delay_ms` variable.