Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pasted text is highlighted #363

Closed
KawaiDesu opened this issue Jan 14, 2021 · 11 comments
Closed

Pasted text is highlighted #363

KawaiDesu opened this issue Jan 14, 2021 · 11 comments

Comments

@KawaiDesu
Copy link

Hi. I've updated my system a few days ago (including terminator and vte libs) and now when I paste text in terminal it's highlighted. There was no such behavior before and this is very annoying. How can I disable that?
List of updated (related) packages:

upgraded vte-common (0.62.1-1 -> 0.62.1-2)
upgraded vte3 (0.62.1-1 -> 0.62.1-2)
upgraded terminator (1.92-2 -> 2.0.1-1)

Screenshot
2021-01-14_16-52

@KawaiDesu
Copy link
Author

KawaiDesu commented Jan 14, 2021

Also, if I hit Ctrl+C after paste this highlighting will persist in terminal.
image

@mattrose
Copy link
Member

Hmm, when I paste text on my Fedora workstation the pasted text doesn't appear highlighted. It does on my mac however. This leads me to believe that there is something on another level that is causing this.

Found it. it's this: zsh-users/zsh-syntax-highlighting#349

It's zsh. That explains it. Apparently it can be disabled by: zle_highlight+=(paste:none) in your .zshrc

As to the selected text remaining highlighted. That tells you it is still in the buffer, and that's the text that will be pasted when you hit paste. If you click anywhere else in the window that will clear the selection.

If you want the selection automatically cleared on copy, you can configure that in the Global tab in Preferences.

@KawaiDesu
Copy link
Author

It's zsh
zle_highlight+=(paste:none)

I already found this solution while looking around in Google, but this is not my case. zsh even not installed on my machine. I'm using bash. I think my custom PS1 misleaded you.

If you click anywhere else in the window that will clear the selection

Nope, it doesn't. It's not selection anymore after I press Ctrl+C. It persist even after some curses application (like nano or htop).

P.S. Clean default .bashrc have the same problem.

@mattrose
Copy link
Member

I'm not seeing this with 2.1.0 and Fedora on GNOME and bash even with a default .bashrc. Is there something in the OS default bash configuration that could be causing this?

What WM/DE are you using?
What Linux distro are you using?

@KawaiDesu
Copy link
Author

Archlinux
DE: Cinnamon 4.8.5
WM: Mutter (Muffin)
WM Theme: Mint-Y-Dark-Aqua (Mint-Y-Yltra-Dark)

Do you need my terminator config?

@mattrose
Copy link
Member

Sure, but I can't promise I'll take a stab at reproducing it any time soon. That config is going to take me a while to set up, and I don't have good access to my archlinux box right now.

Can you see if you can reproduce it with a different WM/DE like GNOME or KDE?

@pipatron
Copy link

pipatron commented Feb 4, 2021

This happens to me on a completely different system, with the latest master, in exactly the same way as OP describes (doesn't go away after clicking etc).

I run Debian Testing with Gnome 3.38.3 on Wayland. No zsh involved.

It was like this before the latest master too, but I'm afraid I don't remember which version I used before that. It makes no difference if I paste by middle-click or by the "Paste" option in the menu.

@bsiem
Copy link

bsiem commented Feb 9, 2021

Yes, it is bash. From the manual:

https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html

enable-bracketed-paste

When set to ‘On’, Readline will configure the terminal in a way that will enable it to insert each paste into the editing buffer as a single string of characters, instead of treating each character as if it had been read from the keyboard. This can prevent pasted characters from being interpreted as editing commands. The default is ‘On’.

@pipatron
Copy link

pipatron commented Feb 9, 2021

Yes, it is bash. From the manual:

https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html

enable-bracketed-paste

Makes sense, although it doesn't mention any highlights. In any case, I do see the same behavior even in good-old xterm now.

@KawaiDesu
Copy link
Author

Can you see if you can reproduce it with a different WM/DE like GNOME or KDE?

Also reproduced by me in different terminal (terminology) in my DE and by my friend in Arch+KDE+Kitty but not in Ubuntu 20 + Mate.

enable-bracketed-paste

This looks like a nice feature (for example - pasted text with \n at the end is does not executed). I tried to disable it and highliting is gone. Still a question why it has such behavior.

@mattrose
Copy link
Member

mattrose commented Feb 9, 2021

Thanks so much for looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants