Skip to content

Commit

Permalink
edit: always adjust the terminal states with "bind -x"
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Mar 1, 2023
1 parent a5b10e8 commit 5d14cf1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contrib
1 change: 1 addition & 0 deletions docs/ChangeLog.md
Expand Up @@ -475,6 +475,7 @@
- term (`terminology`): work around terminal glitches `#D1946` 9a1b4f9
- main (`ble/bin/awk`): add workaround for macOS `awk-32` `#D1974` e2ec89c
- util.hook: workaround bash-5.2 bug of nested read by `WINCH` `#D1981` xxxxxxx
- edit: always adjust the terminal states with `bind -x` (reported by linwaytin) `#D1983` xxxxxxx

## Test

Expand Down
24 changes: 24 additions & 0 deletions note.txt
Expand Up @@ -6661,6 +6661,30 @@ bash_tips

2023-03-01

* decode: compat zoxide bind -x (reported by linwaytin) [#D1983]
https://github.com/akinomyoga/ble.sh/issues/293

leave-for-widget を毎回呼ぶ事にしてしまっても良いのでは。

? ここで fzf-key-bindings の advice を残すかどうかが問題になる。もしこれら
の関数を completion にも流用しようとしている人がいてこれらを直接呼び出し
たとすると問題になる。しかし、fzf-completion を弄って (もしくは自分で新し
く設定を作って) いる人がいたら何れにしても fzf-completion はちゃんと動か
ない。なので、現状で中途半端に fzf-key-bindings の中の関数だけ patch して
も余り意味は無いのではないか。

やはり単純に削除してしまって良い気がする。

* ok: もう一つの懸念事項は bind -x の全てに対して毎回呼び出すと重くなるので
はないかという事。うーん。ble.sh の上で更に ble.sh 的な事をしようという様
な事がない限りは多少エスケープシーケンスが端末に沢山送られても別に大した
処理量にはならない気がする。

但し、visible-bell/erase に関してはファイル等をチェックする等するはずなの
で多少のコストはあるかもしれない。然し、ble/util/assign 等もっと沢山の非
自明な事をしているのだから bind -x の時にファイルを確認するぐらいであれば
無視できる筈である。

* 2023-02-21 histdb: 終了時に sqlite3 のエラーが発生して失敗する事がある [#D1982]

Runtime error near line 779: database is locked (5)
Expand Down
3 changes: 2 additions & 1 deletion src/edit.sh
Expand Up @@ -10346,8 +10346,9 @@ function ble/widget/.EDIT_COMMAND {
local -x READLINE_ARGUMENT=$_ble_edit_arg
ble/edit/enter-command-layout # #D1800 pair=leave-command-layout
ble/widget/.hide-current-line keep-header
ble/util/buffer.flush >&2
ble/term/leave-for-widget
builtin eval -- "$command"; local ext=$?
ble/term/enter-for-widget
ble-edit/content/clear-arg
ble/edit/leave-command-layout # #D1800 pair=enter-command-layout

Expand Down

0 comments on commit 5d14cf1

Please sign in to comment.