diff --git a/memo.txt b/memo.txt index 2d5d1964..46d31fb8 100644 --- a/memo.txt +++ b/memo.txt @@ -3251,6 +3251,23 @@ bash_tips Done (実装ログ) ------------------------------------------------------------------------------- +2019-07-17 + + * decode: DA1 応答の読み取りに失敗して変な文字列が入力される (reported by miba072) [#D1135] + https://github.com/akinomyoga/ble.sh/issues/28 + + どうも DA2 に対して DA1 応答が為されている様である。DA1 に応答する様に修正した。 + + 後、よく考えたら認識できないキーシーケンスはその時点で破棄するべきでは。 + と思ったがデフォルトで破棄する設定になっている様な…。 + 或いは ble-0.3 の時点では状況が違っただろうか。 + どうも調べると 0.3 では CSI seq に関してはちゃんと処理していない様だ。 + うーん。色々修正しなければならなそう。 + + 念の為、以前 0.4 で何処で修正したのかを確認する。 + 2019-04-01 ab1b8b0 である。#D1056 だ。 + うーん。ab1b8b0 を覗いたら別に他に影響も無さそうなので cherry-pick してしまう事にした。 + 2019-07-16 * highlight: ファイル名のディレクトリ部分の着色で、 [#D1134] diff --git a/src/decode.sh b/src/decode.sh index 97ccadbd..552cd952 100644 --- a/src/decode.sh +++ b/src/decode.sh @@ -620,9 +620,14 @@ function ble-decode-char/csi/.decode { fi fi elif ((char==99)); then # c - if rex='^>'; [[ $_ble_decode_csi_args =~ $rex ]]; then + if rex='^[?>]'; [[ $_ble_decode_csi_args =~ $rex ]]; then + # DA1 応答 "CSI ? Pm c" (何故か DA2 要求に対して DA1 で返す端末がある?) # DA2 応答 "CSI > Pm c" - ble/term/DA2/notify "${_ble_decode_csi_args:1}" + if [[ $_ble_decode_csi_args == '?'* ]]; then + ble/term/DA1/notify "${_ble_decode_csi_args:1}" + else + ble/term/DA2/notify "${_ble_decode_csi_args:1}" + fi csistat=$_ble_decode_KCODE_IGNORE return fi diff --git a/src/history.sh b/src/history.sh index 97602021..96487e60 100644 --- a/src/history.sh +++ b/src/history.sh @@ -223,7 +223,7 @@ if ((_ble_bash>=40000)); then # 47ms _ble_history 初期化 (37000項目) (3) _ble_history_load_bgpid= if [[ $opt_cygwin ]]; then - # 620ms Cygwin (99000項目) + # 620ms Cygwin (99000項目) cf #D0701 source "$history_tmpfile" else builtin mapfile -O "$arg_offset" -t _ble_history < "$history_tmpfile" diff --git a/src/util.sh b/src/util.sh index 19d61bf4..2de41faf 100644 --- a/src/util.sh +++ b/src/util.sh @@ -2749,10 +2749,10 @@ function ble/term/bracketed-paste-mode/leave { #---- DA2 --------------------------------------------------------------------- +_ble_term_DA1R= _ble_term_DA2R= -function ble/term/DA2/notify { - _ble_term_DA2R=$1 -} +function ble/term/DA1/notify { _ble_term_DA1R=$1; } +function ble/term/DA2/notify { _ble_term_DA2R=$1; } #---- DSR(6) ------------------------------------------------------------------ # CPR (CURSOR POSITION REPORT)