Skip to content

Commit

Permalink
cmap: add "st"-specific escape sequences for cursor keys
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Aug 30, 2021
1 parent 92c7b26 commit acfb879
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
11 changes: 11 additions & 0 deletions lib/init-cmap.sh
Expand Up @@ -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"
}

Expand Down
9 changes: 5 additions & 4 deletions memo/ChangeLog.md
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
18 changes: 17 additions & 1 deletion note.txt
Expand Up @@ -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 を返答する。

Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/util.sh
Expand Up @@ -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-*)
Expand Down

0 comments on commit acfb879

Please sign in to comment.