From f599525dfb65e338796640bf29dd4d7f08cd00a8 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 16 May 2021 23:50:56 +0900 Subject: [PATCH] util (modifyOtherKeys): work around a quirk of Kitty --- memo/ChangeLog.md | 8 +++++--- note.txt | 52 +++++++++++++++++++++++++++++++++++++++++++++++ src/util.sh | 6 +++++- 3 files changed, 62 insertions(+), 4 deletions(-) diff --git a/memo/ChangeLog.md b/memo/ChangeLog.md index 82b7c21f..2c7c90cd 100644 --- a/memo/ChangeLog.md +++ b/memo/ChangeLog.md @@ -31,7 +31,8 @@ - complete: complete file descriptors and heredoc words after redirections `#D1539` b9b0de4 - main: support `blehook ATTACH DETACH`, `BLE_ONLOAD`, `BLE_ATTACHED` `#D1543` 750ca38 - main: support `ble` `#D1544` 750ca38 -- main (`ble-update`): support package updates and `sudo` updates (motivated by huresche, oc1024) `#D1548` 0000000 +- main (`ble-update`): support package updates and `sudo` updates (motivated by huresche, oc1024) `#D1548` 0bc2660 + - main (`ble-update`): fix help message (contributed by NoahGorny) 50288bf ## Changes @@ -94,8 +95,6 @@ - syntax: fix a bug that `eval() { :; }`, `declare() { :; }` are not treated as function definition `#D1529` b429095 - decode: fix a hang on attach failure by cache corruption `#D1531` 24ea379 - edit, etc: add workarounds for `localvar_inherit` `#D1532` 7b63c60 -- complete: work around bash-completion bugs (reported by oc1024) `#D1533` 9d4ad56 -- main: work around MSYS2 .inputrc (reported by n1kk) `#D1534` 9e786ae - progcomp: fix non-working `complete -C prog` (reported by Archehandoro) `#D1535` 026432d - bind: fix a problem that `bind '"seq":"key"'` causes a loop macro `bind -s key key` (reported by thanosz) `#D1536` ea05fc5 - bind: fix errors on readline macros (reported by RakibFiha) `#D1537` c257299 @@ -107,6 +106,9 @@ - term: work around Cygwin-console bug of bottom `IL`/`DL` `#D1482` 5dce0b8 - term: work around leaked DA2R in screen from outside terminal `#D1485` e130619 - complete: work around `fzf` completion settings loaded automatically `#D1508` 4fc51ae +- complete: work around `bash-completion` bugs (reported by oc1024) `#D1533` 9d4ad56 +- main: work around MSYS2 .inputrc (reported by n1kk) `#D1534` 9e786ae +- util (`modifyOtherKeys`): work around a quirk of Kitty (reported by NoahGorny) `#D1549` 0000000 ## Internal changes and fixes diff --git a/note.txt b/note.txt index 27f0b8ea..b1449a88 100644 --- a/note.txt +++ b/note.txt @@ -4427,6 +4427,58 @@ bash_tips Done (実装ログ) ------------------------------------------------------------------------------- +2021-05-16 + + * work around Kitty bugs (reported by NoahGorny) [#D1549] + https://github.com/akinomyoga/ble.sh/issues/110 + + * とても長いプロンプトにすると列計算が壊れている。 + + | bash-it に追加する事について考えると言っているがどの様な形で追加するのだろ + | うか。コードを直接追加するのだろうか。その場合には色々と微妙。 + | + | * 先ず ble.sh の codebase は bash-it よりも巨大だ。どかんと入れる事が良い事 + | なのか分からない。 + | + | * ble.sh 自体巨大だし UX 自体を大きく書き換える。それ単体として Issue/PR が + | 頻繁にある。もし単純にスクリプトを追加すると、bash-it に issue が沢山立つ + | 事になる。それよりは ble.sh の側に Issue が来て欲しい。 + | + | * 実は結構好みが別れる様であるという事。autosuggestion を off にしたいと + | いう人もいたりするし、syntax-highlighting が遅いという人もいる (これは + | 完全なる思い込みだと思うが…)。 + | + | * 独立した設定ファイルが存在するという事から、ユーザーにちゃんと説明する + | 必要があるという事。 + | + | * 自分勝手な事だけれども、bash-it の一部として普通になってしまうと star が + | こっちに来なくなる。bash-it の方がメインだと思われるのは嫌である。 + | + | * bash-it 自体にパッケージマネージ機能などがあればそれを通してインストール + | して貰うのが良いという気がする。それがなくても単に git clone etc. を内部 + | 的にして貰うのが良いという気がする。 + | + | * theme の充実を図りたい。これは渡りに船なのではないか。然し、bash-it にも + | theme があるのだという事。 + | + | * gitstatus.plugin.bash を見ると別に他のプロジェクトをそのまま追加している + | という訳ではない様である。存在が確認できた時に追加の設定を行っている様に + | 見える。 + + 何だかそういう雰囲気でもなくなったので気にしない事にする。 + + 未だ Kitty で変な状態になるそうである。例えば setsid 関係で何か変な事が起こっ + ている可能性? と思ったがもしそうだとするともっと滅茶苦茶な事が起こる様なの + でこれは多分関係ないのだと思う。 + + ble-detach をした後でも問題が再現しているという事を述べている。うーん。試し + てみたら分かった。これは modifyOtherKeys の解除ができていない。\e[>4;0m が + 効いていないという事なのだろうか。と思ったら、どうもそういう訳でもない。 + printf $'\e[>4;0m' を送ったらちゃんと動く様になる。 + + 改めて詳しく見てみると…どうも external の既定は 1 の様である。取り敢えず + workaround を追加する。 + 2021-05-15 * package: AUR package (suggested by huresche, help by oc1024) [#D1548] diff --git a/src/util.sh b/src/util.sh index d78158e2..98e30b4f 100644 --- a/src/util.sh +++ b/src/util.sh @@ -5140,7 +5140,11 @@ function ble/term/modifyOtherKeys/leave { if [[ $value == auto ]]; then value=1 # 問題を起こす端末で無効化。 - ble/term/modifyOtherKeys/.supported || value= + if [[ $TERM == xterm-kitty ]]; then + value=0 # Kitty は 1 では無効にならない。変な振る舞い + else + ble/term/modifyOtherKeys/.supported || value= + fi fi ble/term/modifyOtherKeys/.update "$value" }