This happens. Typing:
$ qwer
$ asdf
$ zxcv
up-arrow twice, backspace, backspace, down-arrow twice, then:
$ history 4
519 qwer
520* as
521 zxcv
522 history 4
The star by 520
tells me it's an intended feature.
I do not know how to control this kind of history editing. It has been in the way many more times than it has helped me, and I would like to disable it.
Answer
This is handled by readline. To change it you need to add set revert-all-at-newline on
to your /etc/inputrc
(or ~/.inputrc
) if you have it. Note that you don't even have to start a new subshell after modifying inputrc
because you can invoke re-read-init-file
function which is binded to Ctrl-x Ctrl-r by default:
$ bind -p | grep read
"\C-x\C-r": re-read-init-file
No comments:
Post a Comment