From acfb8790bacf7810a0594e9610d143e83b305aaf Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 30 Aug 2021 19:31:58 +0900 Subject: [PATCH] cmap: add "st"-specific escape sequences for cursor keys --- lib/init-cmap.sh | 11 +++++++++++ memo/ChangeLog.md | 9 +++++---- note.txt | 18 +++++++++++++++++- src/util.sh | 2 +- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/lib/init-cmap.sh b/lib/init-cmap.sh index 41c081b0..1f2059bf 100644 --- a/lib/init-cmap.sh +++ b/lib/init-cmap.sh @@ -280,6 +280,17 @@ function ble/init:cmap/initialize { # ble-bind -k "CAN @ m" meta # ble-bind -k "CAN @ s" super + # st specific + ble/init:cmap/bind-single-csi '2 J' S-home + ble/init:cmap/bind-single-csi 'J' C-end + ble/init:cmap/bind-single-csi 'K' S-end + ble/init:cmap/bind-single-csi '4 l' S-insert + ble/init:cmap/bind-single-csi 'L' C-insert + ble/init:cmap/bind-single-csi '4 h' insert + # ble/init:cmap/bind-single-csi 'M' C-delete # conflicts with kpent + ble/init:cmap/bind-single-csi '2 K' S-delete + ble/init:cmap/bind-single-csi 'P' delete + ble/edit/info/immediate-show text "ble/lib/init-cmap.sh: updating key sequences... done" } diff --git a/memo/ChangeLog.md b/memo/ChangeLog.md index b7a455b6..732fa5be 100644 --- a/memo/ChangeLog.md +++ b/memo/ChangeLog.md @@ -63,7 +63,7 @@ - prompt: support a new backslash sequence `\g{...}` `#D1609` be31391 - complete: add a new option `bleopt complete_limit_auto_menu` `#D1618` 1829d80 - rlfunc: support vi word operations in `emacs` keymap (requested by SolarAquarion) `#D1624` 21d636a -- edit: support `TMOUT` for the session timeout `#D1631` 0000000 +- edit: support `TMOUT` for the session timeout `#D1631` 0e16dbd ## Changes @@ -146,8 +146,8 @@ - benchmark (`ble-measure`): fix a bug that the result is always 0 in Bash 3 and 4 (fixup bbc2a904) `#D1615` a034c91 - complete: fix a bug that the shopt settings are not restored correctly (reported by Lun4m) `#D1623` 899c114 - decode, canvas, etc.: explicitly treat CSI arguments as decimal numbers (reported by GorrillaRibs) `#D1625` c6473b7 2ea48d7 -- history: fix the vanishing history entry used for `ble-attach` `#D1629` 0000000 -- global: work around readonly `TMOUT` (reported by farmerbobathan) `#D1630` 0000000 +- history: fix the vanishing history entry used for `ble-attach` `#D1629` eb34061 +- global: work around readonly `TMOUT` (reported by farmerbobathan) `#D1630` 44e6ec1 ## Optimization @@ -183,7 +183,8 @@ - decode: work around kitty keypad keys in modifyOtherKeys (reported by Nudin) `#D1626` 27c80f9 - util (`modifyOtherKeys`): update the workaround for a new quiark of kitty `#D1627` 3e4ecf5 - main: work around `set -B` and `set -k` `#D1628` a860769 -- term: disable `modifyOtherKeys` and do not send `DA2` for `st` (requested by Shahabaz-Bagwan) `#D1632` 0000000 +- term: disable `modifyOtherKeys` and do not send `DA2` for `st` (requested by Shahabaz-Bagwan) `#D1632` 92c7b26 +- cmap: add `st`-specific escape sequences for cursor keys `#D1633` 0000000 ## Internal changes and fixes diff --git a/note.txt b/note.txt index b6b33ed8..1d858782 100644 --- a/note.txt +++ b/note.txt @@ -4914,9 +4914,22 @@ bash_tips Done (実装ログ) ------------------------------------------------------------------------------- +2021-08-30 + + * 2021-08-19 st: insert で CSI 4h を送るなど色々変な key sequence を送ってくる [#D1633] + + 他に以下の物が見られる。 + + CSI L (C-insert) + CSI J (C-end) + + 他にも色々ありそうなので一つ一つ既に実装されている物と見比べて調べる必要が + ある。幾つか追加した。ESC[M は他とかちあっている。 + 2021-08-19 - * st: unknown csi error message (reported by ) [#D1632] + * st: unknown csi error message (reported by Shahabaz-Bagwan) [#D1632] + https://github.com/akinomyoga/ble.sh/issues/132 * 先ず st は DA2 に応答しない。DA1 に対して CSI ?6c を返答する。 @@ -4938,6 +4951,9 @@ bash_tips ことである。もしちゃんと対応するのだとしたらまずは st をちゃんと検出でき る様にしなければならない。 + 2021-08-26 minux になっている箇所がある。 + 2021-08-30 #D1633 で一緒に直した。 + 2021-07-19 * edit: support TMOUT for session timeout [#D1631] diff --git a/src/util.sh b/src/util.sh index 8cbdc943..14174445 100644 --- a/src/util.sh +++ b/src/util.sh @@ -5614,7 +5614,7 @@ function ble/term/modifyOtherKeys/.supported { # Note #D1213: linux (kernel 5.0.0) は "\e[>" でエスケープシーケンスを閉じ # てしまう。5.4.8 は大丈夫だがそれでも modifyOtherKeys に対応していない。 return 1 ;; - (minux|sun*) + (minix|sun*) # minix, Solaris のコンソールもそのまま出力してしまう。 return 1 ;; (st|st-*)