Skip to content

Commit

Permalink
util (modifyOtherKeys): work around a quirk of Kitty
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed May 16, 2021
1 parent 50288bf commit f599525
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 4 deletions.
8 changes: 5 additions & 3 deletions memo/ChangeLog.md
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -107,6 +106,9 @@
- term: work around Cygwin-console bug of bottom `IL`/`DL` `#D1482` 5dce0b8
- term: work around leaked <kbd>DA2R</kbd> 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

Expand Down
52 changes: 52 additions & 0 deletions note.txt
Expand Up @@ -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]
Expand Down
6 changes: 5 additions & 1 deletion src/util.sh
Expand Up @@ -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"
}
Expand Down

0 comments on commit f599525

Please sign in to comment.