Bash history editing unwanted

1

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.

Gauthier

Posted 2016-10-04T07:14:20.153

Reputation: 1 003

1

Possible duplicate of How to prevent Bash from altering history?

– Gray -- SO stop being evil – 2019-10-15T18:42:13.520

Answers

1

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

Arkadiusz Drabczyk

Posted 2016-10-04T07:14:20.153

Reputation: 1 776