Skip to content
Myr

[zsh] Keep current $BUFFER on ALT-C

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Ideally, we could only use `print -sr` to update the command history. However, the "cd" command by ALT-C is added to the history only after we finalize the current command by pressing an additional enter key. i.e. The cd command from ALT-C is not visible when you hit Up arrow. But it appears once you hit enter key. So when the current buffer is empty, we use `zle accept-line` so that the command history is immediately updated. Close #2200

authored by Junegunn Choi · committed by Junegunn Choi · parent 82c4af2 · Browse files · 1 file+8 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−3 removed

  • other:+8 added−3 removed

1 file+8 added−3 removed

modified:shell/key-bindings.zsh+8 added-3 removed