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: 3618

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