From 9b331c40d47193fe9d207cf182f2e2afbedb56fb Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 2 Mar 2022 18:01:03 +0900 Subject: [PATCH] util (CPR): fix the problem of always timing out (fixup 1481d48) --- docs/ChangeLog.md | 1 + note.txt | 25 ++++++++++++++++++++++--- src/util.sh | 2 ++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md index a28e6999..f2a88ed7 100644 --- a/docs/ChangeLog.md +++ b/docs/ChangeLog.md @@ -133,6 +133,7 @@ - Makefile: work around the case the repository is cloned without `--recursive` `#D1655` 22ace5f - repo: add subdirectories `make` and `docs` `#D1657` 75bd04c - util: time out CPR requests `#D1669` 1481d48 + - util (CPR): fix the problem of always timing out (fixup 1481d48) `#D1792` 0000000 - main: suppress non-interactive warnings from manually sourced startup files (reported by andreclerigo) `#D1676` 0525528 88e2df5 - mandb: integrate `mandb` with `bash-completion` (motivated by Shahabaz-Bagwan, bbyfacekiller and EmilySeville7cfg) `#D1688` c1cd666 - syntax: do not start argument completions immediately after previous word (reported by EmilySeville7cfg) `#D1690` 371a5a4 diff --git a/note.txt b/note.txt index 575b4dab..7cc6d49f 100644 --- a/note.txt +++ b/note.txt @@ -1813,9 +1813,6 @@ bash_tips 2022-02-20 - * BUG 何故か2回目の char_width_@=auto がちゃんと動いていない気がする。何故だ - ろうか。後で確認する。 - * BUG complete: cygwin$ pdflatex [TAB] で /usr/bin/cat: '': No such file or directory というエラーが出力される。chat では再現しない。bash-completion は ロードされていない。 @@ -6155,6 +6152,28 @@ bash_tips 2022-03-02 + * canvas: BUG 何故か2回目の char_width_@=auto がちゃんと動いていない気がする [#D1792] + Ref #D1669 + + 何故だろうか。後で確認する。 + + 改めて試してみたがゆっくりやれば何度やっても問題はない。auto を代入してから + 急激に RET 等を実行するとそれ以降は常に west, 7.0 にしかならなくなる。CPR + 応答の順序がずれてしまっている可能性? 何処かのタイミングでずれを修正したら + 治るのだろうか。 + + * _ble_term_CPR_hook に何か変な物が残存している可能性を確認。 + + →分かった。逆だった。timeout のコードが悪さをしていた。timeout 時刻の更 + 新を行っていなかったので常に timeout する状態になっていてまともに CPR が + 受信できなくなっていた。 west, 7.0 というのは CPR 応答がなかった時の既定 + の値という事だろう。 + + ! ? そもそもどの様にしてずれが起こるのか。初めのずれが起こらない様に調整でき + ! るのではないか。 + + 結局 #D1669 の単純なバグだった。修正した。 + * blehook -+= は入力しにくいし見にくいので != を一意追加として対応する [#D1791] * done: != ... 未だ登録されていない時に追加する diff --git a/src/util.sh b/src/util.sh index e31f6127..28f093b8 100644 --- a/src/util.sh +++ b/src/util.sh @@ -6171,6 +6171,7 @@ _ble_term_CPR_hook=() function ble/term/CPR/request.buff { ((SECONDS>_ble_term_CPR_last_seconds+_ble_term_CPR_timeout)) && _ble_term_CPR_hook=() + _ble_term_CPR_last_seconds=$SECONDS ble/array#push _ble_term_CPR_hook "$1" ble/util/buffer $'\e[6n' return 147 @@ -6178,6 +6179,7 @@ function ble/term/CPR/request.buff { function ble/term/CPR/request.draw { ((SECONDS>_ble_term_CPR_last_seconds+_ble_term_CPR_timeout)) && _ble_term_CPR_hook=() + _ble_term_CPR_last_seconds=$SECONDS ble/array#push _ble_term_CPR_hook "$1" ble/canvas/put.draw $'\e[6n' return 147