I have this setting in my ~/.inputrc
file:
set editing-mode vi
but the behavior is the same if I have
set -o vi
in `~/.bashrc. In addition I also have
export VISUAL=vim
export EDITOR="$VISUAL"
in the latter file.
The buggy behavior I observed is reproducible as follows:
cd existingFolder
,vi
/vim
,Result: the current directory has changed, but the prompt, if it shows the currect directory, has not updated to reflect the change of it.
Is this a bug or an expected behavior?
A screencast is better than a thousand words:
This happens independently of vim
, vi
, or bash's vi
mode.
A MCVE is this:
$ cd /usr && env -i EDITOR='touch' PS1='\w \$ ' bash --norc
/usr $ cd bin # press Ctrl-X Ctrl-E instead of Enter here
cd bin
/usr $ pwd # Bug visible here, prompt should say `/usr/bin`
/usr/bin
/usr/bin $ # Prompt now showing expected value
The prompt fails to update, and PROMPT_COMMAND
is not executed. Upstream git commit 6c6454cb1 from 2020-02-07 shows the same behavior.
So to answer the question, yup, looks like a bug.