Skip to content

Commit

Permalink
prompt: force update "PS0" between multiple commands
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed May 20, 2021
1 parent 6e0245a commit 8f29203
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions memo/ChangeLog.md
Expand Up @@ -69,6 +69,7 @@
- main: accept non-regular files as `blerc` and add option `--norc` `#D1530` 7244e2f
- prompt: let `stderr` pass through to tty in evaluating `PS0` (reported by tycho-kirchner) `#D1541` 24a88ce
- prompt: adjust behavior of `LINENO` and prompt sequence `\#` (reported by tycho-kirchner) `#D1542` 8b0257e
- prompt: update `PS0` between multiple commands (motivated by tycho-kirchner) `#D1560` 000000
- edit (`widget:display-shell-version`): include `ble.sh` version `#D1545` 750ca38
- complete (`ble-sabbrev`): support colored output `#D1546` 750ca38
- decode (`ble-bind`): support colored output `#D1547` 750ca38
Expand Down
8 changes: 8 additions & 0 deletions note.txt
Expand Up @@ -4618,6 +4618,14 @@ bash_tips

2021-05-20

* prompt: update "PS0" between multiple commands (motivated by tycho-kirchner) [#D1560]

複数のコマンドが一度に実行される時に、それぞれのコマンドについて PS0 が呼び
出される。然し其処から参照される $# の値が更新されない様だった。調べてみる
と、PS0 の更新をチェックする時に、更新の必要があるかどうかの判定をする hash
値が複数のコマンドの間で変化がない為に更新が省略されていたという事。
→hash に $# ($_ble_edit_CMD) も含める様にして対処する事にする。

* decode (ble-bind): ble-bind -m KEYMAP で全ての keymap が出力されている (fixup 750ca38) [#D1559]

これは指定した keymap を表示する様にした方が良い。というか元々そのつもりだっ
Expand Down
2 changes: 1 addition & 1 deletion src/edit.sh
Expand Up @@ -4757,7 +4757,7 @@ fi
_ble_edit_prompt0=()
function ble-edit/exec/print-PS0 {
if [[ $PS0 ]]; then
local version=$COLUMNS:$_ble_edit_lineno:$_ble_history_count
local version=$COLUMNS:$_ble_edit_lineno:$_ble_history_count:$_ble_edit_CMD
if [[ ${_ble_edit_prompt0[0]} == "$version" ]]; then
local esc=${_ble_edit_prompt0[6]}
else
Expand Down

0 comments on commit 8f29203

Please sign in to comment.