Strange copy paste behavior in terminal (Ubuntu 21.10)

Hello all,

I upgraded from 20.04 LTS to Ubuntu Mate 21.10 in November. One thing that has bothered me since the upgrade is how pasting selected text works in the terminal in Ubuntu Mate 21.10. I have not found others with the same problem, which makes me think am I alone with this :-o

The problem is this: when I select some text, a command for example, so that I paint the line to the very end, and then paste the text on the command line with the middle button of the mouse, normally the command is executed automatically. Now in Ubuntu 21.10 when I drop the text in the terminal, a new line appears in terminal below the pasted text but the command is not executed until I press Enter on my keyboard. Also the pasted text appears in reverse colors, as if I had just selected it. I would prefer it the old-fashioned way: the pasted text appears in normal (not reversed) colors. Where can I adjust this behavior?

When I connect with ssh to some other server, any server, pasting text with middle button works normally. This odd behavior only happens on my workstation, and it started after the installation of Ubuntu Mate 21.10 (I have been using Ubuntu Mate since 2018).

You can thank some creative GNOME developers for this dumb change. (Some people may favor this change, and I respect that, but I don't appreciate the change what-so-ever.) Specifically, recently the library known as VTE got changed by somebody in the GNOME project; VTE is a "virtual terminal emulator" library that is an easy way to embed a terminal emulator into an application, and as the MATE Terminal uses this library for convenience, the MATE Terminal was affected.

I'm not a big Debian package expert, despite how I may make myself look; I thus will not explain how to revert to the old version of VTE myself, as I may well give you bad directions (and I don't want to screw something up for you). However, I hope that this topic gets further attention, and that somebody around here with a knack for "holding back" a package of a specific version, such as @Norbert_X, comes along and explains.

In the meantime, my apologies.

I remember two serious terminal-related bugs

In short this is why I use and recommend to use an LTS version.

1 Like


thank you for your replies, gordon and Norbert_X. Sorry for the delay in replying. I had to recover from Covid-19 infection for a few days, back at work today.

So, it looks like there might be something fishy in the new version of bash and mate-terminal, or how they interact. I tried how tcsh and zsh behave when pasting text. Tcsh behaved like it should, no highlighting, but in zsh the pasted text was also highlighted.

I am a bit hesitant to downgrade the VTE modules of the installation because I fear I might end up in a swamp of failing dependencies. I was hoping there would be some config value that I could change and solve the problem. It doesn't seem likely now. Maybe the best approach would be to replace bash (5.1.8) with the version that came with 20.10 or even with some older version of Ubuntu, if necessary. Hopefully that is enough to get around the problem.

I have so far used only LTS versions of Ubuntu Mate, but I needed some newer software versions, not available in the Focal repo, to make things work like I wanted, so I thought what the heck, let's try the newest Ubuntu Mate and so I installed Impish. All the time my plan has been to install 22.04 LTS when it becomes available. Let's hope this problem has been fixed by the time it gets published.

If this is indeed a problem caused by changes in bash, I must say I am absolutely astonished. Actually, it doesn't even matter, where the problem is. Why go and change something that elemental and well-functioning, without giving a choice to the users to configure it the way they want??? I think it is a breach of holy principles.

1 Like

I installed Jammy in Virtual Box to see what is happening with this. Doesn't look good. I upgraded VTE to its newest version, 0.68. That didn't help with the problem. Then I tried downgrading VTE to the version that was used in Focal - where this problem didn't exist - but the result was pretty catastrophic. Terminal disappeared from the installation entirely, and so did the graphical tool for installing software. I am glad it was just a Virtual Box test installation :hushed:

It looks like the good guys at Ubuntu Mate are not going to do a lot to fix this situation.