5

Since some update of the zsh a new behaviour of the shell was appeared. I.e. now when I paste a text from the buffer (via the paste command or via the 3rd mouse button -- no matter) it "selected" -- the background of the inserted text is highlighted as if I had selected it. The selection is disappeared if I press a cursor movement keys, for example.

I use the zsh in the konsole terminal (KDE 5). Now versions of the programs are:

  • konsole - 16.12
  • zsh - 5.3
  • grml-zsh-config - 0.12.6

My distro is the Arch.

Is there any chance to return an old behaviour?

2 Answers 2

5

This feature was introduced with version 5.1 of zsh. You can disable it by unsetting the variable zle_bracketed_paste:

unset zle_bracketed_paste

Note: Aside from highlighting pasted text (which is, as far as I understand, actually done by the terminal) it also prevents ZLE from parsing special characters like tabs and newlines. This means for example that if you paste multiline text, zsh will not automatically (try to) run each line as if it were a command, instead the whole text will be pasted as a whole with literal tabs and newlines.

3

In case you'd like to keep bracketed paste - the feature that causes this - enabled (it improves safety), it's possible to simply disable the highlighting of pasted text by adding this to ~/.zshrc:

zle_highlight=('paste:none')

Source

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.