lxqt / qterminal

A lightweight Qt-based terminal emulator
https://lxqt.github.io
GNU General Public License v2.0
598 stars 150 forks source link

Selection not cleared in bracketed paste mode #1137

Closed stefonarch closed 4 months ago

stefonarch commented 4 months ago

It happens quite often here.

Expected Behavior

Only one selected text should be shown and should clear

Current Behavior

Sometimes multiple selections are shown with one persistent that can't be cleared. There are several ways to make this happens.

Steps to Reproduce (for bugs)

One way to reproduce it is

  1. Select a command like in the screenshot
  2. Paste it
  3. hit ctrl+c
  4. the selection remains permanent and can be repeated while the "true" selection is rocm-5.7.1:

immagine

System Information
tsujan commented 4 months ago

Maybe it's random, because I can't reproduce it here; tried more than 5 times.

stefonarch commented 4 months ago

With the described steps it's always reproducible. But beside the selection highlighting not reset: why is pasted text highlighted here? It is cleared on enter when the command is executed.

stefonarch commented 4 months ago

Just tested console, exact the same issue.

tsujan commented 4 months ago

why is pasted text highlighted here?

Oh, that explains the different results. I check Terminal settings → Behavior → Forcefully disable bracketed paste mode. The bracketed paste mode started to be the default mode everywhere 4 years ago. As I disliked it, I added and used that option.

With the bracketed paste mode, I can reproduce the problem.

tsujan commented 4 months ago

Just tested console, exact the same issue

When it's the same with XTerm too, I guess it's a "feature" of the bracketed paste mode.

Closing this?

stefonarch commented 4 months ago

xterm doesn't support pasting. Maybe it's inherited, but having multiple selections visible which can't be reset is an issue IMO, and I'm quite sure it happens in other circumstances as well as I see it often happen.

tsujan commented 4 months ago

xterm doesn't support pasting.

It does, by middle-clicking.

tsujan commented 4 months ago

and I'm quite sure it happens in other circumstances

Just disable the bracketed paste mode and get rid of it. I had a reason to add that option 4 years ago ;) (→ https://github.com/lxqt/qtermwidget/pull/390 and https://github.com/lxqt/qterminal/pull/772)

tsujan commented 4 months ago

Although testing with XTerm seemed enough to me, I also installed gnome-terminal: exactly the same "feature" showed up there.

I really think this isn't our problem to solve. At least, we have an option for it.

stefonarch commented 4 months ago

Ok, changed the title.