From 080a11eb7374af3335bde3841789bd2b659237c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Thu, 15 Dec 2022 11:49:51 -0500 Subject: [PATCH 1/7] bind control-shift-u to unicode-input, move urls to o Having a keybinding to invoke arbitrary unicode characters is very useful. It's often used as a method of last resort to communicate with people outside of your main language. For example, if you want to type the last letter of my real name, you can invoke the latin-1 character 0xe9 or unicode 0x00e9. You can also use this to type special characters, for example, unicode U+1F4A9 is of course, the infamous PILE OF POO, which is sure to produce million laughs everywhere you go. In foot, there's no keybinding by default to invoke the very useful unicode-input command. There is no "standard" (as in "ISO") keybinding this either. But there *is* a de-facto standard currently deployed by *both* GTK and Qt (a rare feat) *and* Chrome OS (an even rarer feat) and it's control-shift-u. Alternatives include Control-x 8 (emacs), Control V u (vim), Alt (Windows, LibreOffice), or Option (Mac). I doubt we want to adopt any of those. So let's use control-shift-u for this. Unfortunately, it's currently assigned to show-urls-launch, which is unfortunate, but insurmountable. We can reassign this keybinding elsewhere. I have picked control-shift-o in my configuration, because "o" is a good mnemonic for "open URLs". Others have suggested "m" instead. Closes: #1183 --- CHANGELOG.md | 4 ++++ config.c | 3 ++- doc/foot.1.scd | 2 +- doc/foot.ini.5.scd | 4 ++-- foot.ini | 4 ++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87a35bdd..f02cf039 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,9 @@ ### Changed * Minimum required meson version is now 0.59 ([#1371][1371]). +* `Control+Shift+u` now bound to `unicode-input` to follow the + convention established in GTK and Qt, `show-urls-launch` now bound + to `Control+Shift+o` ([#1183][1183]) * Kitty keyboard protocol: F3 is now encoded as `CSI 13~` instead of `CSI R`. The kitty keyboard protocol originally allowed F3 to be encoded as `CSI R`, but this was removed from the specification @@ -92,6 +95,7 @@ removed. [1371]: https://codeberg.org/dnkl/foot/pulls/1371 +[1183]: https://codeberg.org/dnkl/foot/issues/1183 [1360]: https://codeberg.org/dnkl/foot/issues/1360 [1383]: https://codeberg.org/dnkl/foot/issues/1383 diff --git a/config.c b/config.c index 5297bbdc..1cefba3e 100644 --- a/config.c +++ b/config.c @@ -2807,7 +2807,8 @@ add_default_key_bindings(struct config *conf) {BIND_ACTION_FONT_SIZE_RESET, m_ctrl, {{XKB_KEY_0}}}, {BIND_ACTION_FONT_SIZE_RESET, m_ctrl, {{XKB_KEY_KP_0}}}, {BIND_ACTION_SPAWN_TERMINAL, m_ctrl_shift, {{XKB_KEY_n}}}, - {BIND_ACTION_SHOW_URLS_LAUNCH, m_ctrl_shift, {{XKB_KEY_u}}}, + {BIND_ACTION_SHOW_URLS_LAUNCH, m_ctrl_shift, {{XKB_KEY_o}}}, + {BIND_ACTION_UNICODE_INPUT, m_ctrl_shift, {{XKB_KEY_u}}}, {BIND_ACTION_PROMPT_PREV, m_ctrl_shift, {{XKB_KEY_z}}}, {BIND_ACTION_PROMPT_NEXT, m_ctrl_shift, {{XKB_KEY_x}}}, }; diff --git a/doc/foot.1.scd b/doc/foot.1.scd index 1cdf47e4..6143275c 100644 --- a/doc/foot.1.scd +++ b/doc/foot.1.scd @@ -310,7 +310,7 @@ Foot supports URL detection. But, unlike many other terminal emulators, where URLs are highlighted when they are hovered and opened by clicking on them, foot uses a keyboard driven approach. -Pressing *ctrl*+*shift*+*u* enters _“URL mode”_, where all currently +Pressing *ctrl*+*shift*+*o* enters _“Open URL mode”_, where all currently visible URLs are underlined, and is associated with a _“jump-label”_. The jump-label indicates the _key sequence_ (e.g. *”AF”*) to use to activate the URL. diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index ac22ae5a..273a74c2 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -834,7 +834,7 @@ e.g. *search-start=none*. *show-urls-launch* Enter URL mode, where all currently visible URLs are tagged with a jump label with a key sequence that will open the URL (and exit - URL mode). Default: _Control+Shift+u_. + URL mode). Default: _Control+Shift+o_. *show-urls-persistent* Similar to *show-urls-launch*, but does not automatically exit URL @@ -877,7 +877,7 @@ e.g. *search-start=none*. fallback. The preferred way of entering Unicode characters, emojis etc is by using an IME. - Default: _none_. + Default: _Control+Shift+u_. # SECTION: search-bindings diff --git a/foot.ini b/foot.ini index 94d82f6f..2735d370 100644 --- a/foot.ini +++ b/foot.ini @@ -152,12 +152,12 @@ # pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none # pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none # pipe-selected=[xargs -r firefox] none -# show-urls-launch=Control+Shift+u +# show-urls-launch=Control+Shift+o # show-urls-copy=none # show-urls-persistent=none # prompt-prev=Control+Shift+z # prompt-next=Control+Shift+x -# unicode-input=none +# unicode-input=Control+Shift+u # noop=none [search-bindings] From 19e37b17aa9a636a457f952e292612fe4ed315f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 10 Jul 2023 12:36:18 +0200 Subject: [PATCH 2/7] readme: a few more places mentioning the default URL mode shortcut --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 42be5792..5fb7ff4c 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ These are the default shortcuts. See `man foot.ini` and the example sequence](https://codeberg.org/dnkl/foot/wiki#user-content-spawning-new-terminal-instances-in-the-current-working-directory), the new terminal will start in the current working directory. -ctrl+shift+u +ctrl+shift+o : Enter URL mode, where all currently visible URLs are tagged with a jump label with a key sequence that will open the URL. @@ -299,7 +299,7 @@ Foot supports URL detection. But, unlike many other terminal emulators, where URLs are highlighted when they are hovered and opened by clicking on them, foot uses a keyboard driven approach. -Pressing ctrl+shift+u enters _“URL +Pressing ctrl+shift+o enters _“URL mode”_, where all currently visible URLs are underlined, and is associated with a _“jump-label”_. The jump-label indicates the _key sequence_ (e.g. **”AF”**) to use to activate the URL. From 87d45c2a01268bddd42d4a43009413af8a391f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 10 Jul 2023 12:36:41 +0200 Subject: [PATCH 3/7] readme: add default shortcut for unicode input --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 5fb7ff4c..b1cfb37d 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,9 @@ These are the default shortcuts. See `man foot.ini` and the example : Enter URL mode, where all currently visible URLs are tagged with a jump label with a key sequence that will open the URL. +ctrl+shift+u +: Enter Unicode input mode. + ctrl+shift+z : Jump to the previous, currently not visible, prompt. Requires [shell integration](https://codeberg.org/dnkl/foot/wiki#user-content-jumping-between-prompts). From 5b74808ed0d60241417a040e4b82514cbfebeb2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 10 Jul 2023 12:36:55 +0200 Subject: [PATCH 4/7] doc: foot: update default key binding for URL mode --- doc/foot.1.scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/foot.1.scd b/doc/foot.1.scd index 6143275c..62ca0374 100644 --- a/doc/foot.1.scd +++ b/doc/foot.1.scd @@ -202,7 +202,7 @@ default) available; see *foot.ini*(5). _OSC 7_ escape sequence, the new terminal will start in the current working directory. -*ctrl*+*shift*+*u* +*ctrl*+*shift*+*o* Activate URL mode, allowing you to "launch" URLs. *ctrl*+*shift*+*z* From 0e1dbbbd06caf9bcf978e9ca2cca3359e77b54df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 10 Jul 2023 12:37:10 +0200 Subject: [PATCH 5/7] doc: foot: add default key binding for unicode input --- doc/foot.1.scd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/foot.1.scd b/doc/foot.1.scd index 62ca0374..770c7f32 100644 --- a/doc/foot.1.scd +++ b/doc/foot.1.scd @@ -205,6 +205,9 @@ default) available; see *foot.ini*(5). *ctrl*+*shift*+*o* Activate URL mode, allowing you to "launch" URLs. +*ctrl*+*shift*+*u* + Activate Unicode input. + *ctrl*+*shift*+*z* Jump to the previous, currently not visible, prompt. Requires shell integration. From 58898c06339bd1374e975366515d437f22914bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 10 Jul 2023 12:42:10 +0200 Subject: [PATCH 6/7] changelog: split up key binding changes for show-urls-launch and unicode-input --- CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f02cf039..0a36f9c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,9 +64,10 @@ ### Changed * Minimum required meson version is now 0.59 ([#1371][1371]). -* `Control+Shift+u` now bound to `unicode-input` to follow the - convention established in GTK and Qt, `show-urls-launch` now bound - to `Control+Shift+o` ([#1183][1183]) +* `Control+Shift+u` is now bound to `unicode-input` instead of + `show-urls-launch`, to follow the convention established in GTK and + Qt ([#1183][1183]). +* `show-urls-launch` now bound to `Control+Shift+o` ([#1183][1183]). * Kitty keyboard protocol: F3 is now encoded as `CSI 13~` instead of `CSI R`. The kitty keyboard protocol originally allowed F3 to be encoded as `CSI R`, but this was removed from the specification From 3609017c383a74bdb142c5e667fdaa35d11e6da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 10 Jul 2023 12:42:36 +0200 Subject: [PATCH 7/7] =?UTF-8?q?changelog:=20mention=20the=20new=20default?= =?UTF-8?q?=20key=20binding=20for=20show-urls-launch=20under=20=E2=80=9Cfi?= =?UTF-8?q?xed=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It “fixes” the key binding conflict seen on e.g. GNOME, and increases the exposure of the change to, hopefully, more users. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a36f9c7..968dd1a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -126,6 +126,9 @@ 0` ([#1377][1377]). * Crash when scrolling up while running something that generates a lot of output (for example, `yes`) ([#1380][1380]). +* Default key binding for URL mode conflicting with Unicode input on + some DEs; `show-urls-launched` is now mapped to `Control+Shift+o` by + default, instead of `Control+Shift+u` ([#1183][1183]). [1317]: https://codeberg.org/dnkl/foot/issues/1317 [1355]: https://codeberg.org/dnkl/foot/issues/1355