From e1306199a71b44a1c5d1cf30cf25df7e19f0e837 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 22 Feb 2021 11:18:53 +0900 Subject: [PATCH] term: work around leaked "DA2R" in screen from outside terminal --- memo/ChangeLog.md | 9 +++++---- note.txt | 9 +++++++++ src/util.sh | 10 ++++++++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/memo/ChangeLog.md b/memo/ChangeLog.md index df7f0012..01ddb13e 100644 --- a/memo/ChangeLog.md +++ b/memo/ChangeLog.md @@ -54,13 +54,14 @@ - bind: work around broken `cmd_xmap` after switching the editing mode `#D1478` 8d354c1 - edit: clear graphic rendition on newlines and external commands `#D1479` 18bb2d5 - mandb: improve extraction and cache for each locale `#D1480` 3588158 -- decode (rlfunc): work around incomplete bytes in keyseq (reported by onelittlehope) `#D1483` 3559658 beb0383 0000000 +- decode (rlfunc): work around incomplete bytes in keyseq (reported by onelittlehope) `#D1483` 3559658 beb0383 37363be ## Compatibility -- term: work around quirks of Solaris xpg4 awk `#D1481` 0000000 -- term: support key sequences and control sequences of Solaris console `#D1481` 0000000 -- term: work around Cygwin-console bug of bottom `IL`/`DL` `#D1482` 000000 +- term: work around quirks of Solaris xpg4 awk `#D1481` 6ca0b8c +- term: support key sequences and control sequences of Solaris console `#D1481` 6ca0b8c +- term: work around Cygwin-console bug of bottom `IL`/`DL` `#D1482` 5dce0b8 +- term: work around leaked DA2R in screen from outside terminal `#D1485` 0000000 ## Internal changes and fixes diff --git a/note.txt b/note.txt index 7b03bef9..9c8ca461 100644 --- a/note.txt +++ b/note.txt @@ -3740,6 +3740,15 @@ bash_tips Done (実装ログ) ------------------------------------------------------------------------------- +2021-02-22 + + * term: screen で attach した時に時々 _ble_term_* が壊れる現象 [#D1485] + + screen で attach すると何故か色々壊れる現象があったが、どうも contra からの + DA2R がそのまま screen の内部の shell に伝播しているという事の気がする。 + DA2R を受信した時に最初に受信した時の値を保持する様にするべきではないか。 + もしくは一旦受信したら blehook で削除しておく。 + 2021-02-21 * decode (rlfunc): vi-replace in imap, vi-editing-mode in nmap (reported by onelittlehope) [#D1484] diff --git a/src/util.sh b/src/util.sh index 571818c8..2ac3b0db 100644 --- a/src/util.sh +++ b/src/util.sh @@ -4091,6 +4091,7 @@ function ble/term:cygwin/initialize.hook { } function ble/term/DA2R.hook { + blehook DA2R-=ble/term/DA2R.hook case $_ble_term_TERM in (contra) _ble_term_cuu=$'\e[%dk' @@ -4579,8 +4580,13 @@ _ble_term_DA1R= _ble_term_DA2R= function ble/term/DA1/notify { _ble_term_DA1R=$1; blehook/invoke DA1R; } function ble/term/DA2/notify { - _ble_term_DA2R=$1 - ble/term/DA2/initialize-term + # Note #D1485: screen で attach した時に外側の端末の DA2R が混入する + # 事がある。2回目以降に受信した内容は ble.sh の内部では使用しない事 + # にする。 + if [[ ! $_ble_term_DA2R ]]; then + _ble_term_DA2R=$1 + ble/term/DA2/initialize-term + fi blehook/invoke DA2R }