Disable Bash Highlight on Ctrl+R Search or Paste

The Issue

If you've recently updated your Bash or Readline packages, you may have noticed that pasting into the terminal or searching for previous commands with ctrl+r is now highlighting the text, where previously it did not.

ctrl+r searches highlighting

pasted characters are highlighted

This feature was introduced in Readline-8.1. It is referred to as bracketed paste. To disable this new feature, you can either set a compile time flag or edit the files at either /etc/inputrc or preferably ~/.inputrc


The Fix

Run the following command to append to or create the file that will add the option that will disable the highlight.

echo "set enable-bracketed-paste off" >> ~/.inputrc

After running this command you may need to restart your current shell session.


Leave A Comment

Enter the number: 4976

Comment:(*required)


Jerome

THANK YOU ! This is really annoying these new feature...

01-05-2021


Oliver

Thanks a lot. This was really confusing me.

01-06-2021


Jam

Thank you so much! What an annoyance.

02-05-2021


MMGen

Thank you! A highly annoying and unnecessary "improvement".

08-26-2021


Steve L

this is pure gold, thank you! "enable-bracketed-paste" was not even remotely close to the search terms that eventually led me here!

not only is this gratuitous change for change's sake, but it's *ugly* gratuitous change. ugh. a pox on each their homes!

10-24-2021


Sania Akram

Thanks a lot. This was really tough and confusing me.

06-26-2022