Skip to content

Commit 6196849

Browse files
committed
prompt: clear list for the cylic dependency detection
1 parent 16ff7df commit 6196849

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

docs/ChangeLog.md

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
- util(vbell): fix previous vbell not fully cleared `#D2181` 6c740a94
9090
- decode(rlfunc): fix widget name `vi-command/edit-and-execute-{line => command}` (fixed by alexandregv) 6aa8ba67
9191
- util(ble/util/idle.push): fix uninitialized `ble/util/idle.clock` (reported by Anyborr) `#D2189` 83ceb124
92+
- prompt: clear list for the cylic dependency detection (reported by micimize, neilbags) `#D2200` xxxxxxxx
9293

9394
## Compatibility
9495

note.txt

+20
Original file line numberDiff line numberDiff line change
@@ -7334,6 +7334,26 @@ bash_tips
73347334
Done (実装ログ)
73357335
-------------------------------------------------------------------------------
73367336

7337+
2024-04-28
7338+
7339+
* prompt: clear list for the cylic dependency detection (reported by micimize, neilbags) [#D2200]
7340+
https://github.com/akinomyoga/ble.sh/issues/359
7341+
https://github.com/akinomyoga/ble.sh/issues/442
7342+
7343+
どちらも初期化時に発生する。前者は starship と一緒に使っている時のエラーだっ
7344+
たが、後者は starship は使っていない。代わりに atuin を使っている。
7345+
7346+
PS1 の中で循環参照が起こっているのではないかと思ったが、通常の設定である限
7347+
りは unit#update が PS1 によって (間接的であるにしても) 呼び出されるのは変
7348+
である。或いは winch を介してプロンプトの初期化をしている間に、また
7349+
ble/prompt/update が入れ子で呼び出されているのかもしれない。その場合に何が
7350+
起こるか確認する。循環参照の検出には ble_prompt_unit_mark というローカル変
7351+
数を使っている。これは存在していなければその場で作るという形になっている。
7352+
つまり、一番外側の unit#update で空の物を用意するという訳ではない様だ。
7353+
7354+
ble/prompt/update で明示的に空に初期化する事にする。これで PS1 を処理してい
7355+
る間に ble/prompt/update が入れ子で呼び出されたとしても問題ない筈。
7356+
73377357
2024-04-24
73387358

73397359
* menu-complete: support hiding menu (requested by CamRatliff) [#D2199]

src/edit.sh

+3
Original file line numberDiff line numberDiff line change
@@ -1932,6 +1932,9 @@ function ble/prompt/update {
19321932
local prompt_rows=${LINES:-25}
19331933
local prompt_cols=${COLUMNS:-80}
19341934
local "${_ble_prompt_cache_vars[@]/%/=}" # WA #D1570 checked
1935+
# clear the list for cyclic dependency detection
1936+
local ble_prompt_unit_processing=1
1937+
"${_ble_util_set_declare[@]//NAME/ble_prompt_unit_mark}"
19351938

19361939
ble/prompt/unit#update _ble_prompt_ps1 && dirty=1
19371940

0 commit comments

Comments
 (0)