We upgraded to bash 5.1 a few months ago now (Jan 20 to be exact), and with that came an upgrade to readline 8.1. With readline 8.1, the "bracketed paste" feature was made default, which highlights your pasted text (from primary selection) as well as reverse-search matches.
This has been low-key bugging me for the past 2 months, but I couldn't figure out how to search for the issue I was experiencing.
I imagine some people like this new feature, but for those of you who—like me—are not ready to embrace this change, you can revert back to the old behavior by changing either your ~/.inputrc
or ~/.bash_profile
:
Method 1: affects all readline clients (bash, python, ...)
Create ~/.inputrc
and add this line (or append this line to your existing file):
set enable-bracketed-paste off
Method 2: only affects bash
Add this line to your ~/.bash_profile
:
bind 'set enable-bracketed-paste off'
Screenshots
With bracketed paste enabled:
Disabled (old behavior):