lxterminal icon indicating copy to clipboard operation
lxterminal copied to clipboard

feature request: Automatic copy to clipboard when text is selected

Open mahdix opened this issue 6 years ago • 10 comments

mahdix avatar Feb 01 '18 01:02 mahdix

it would be very helpful to have this function

rbroggi avatar Feb 28 '18 15:02 rbroggi

It already seems to copy to a buffer. For example, I can middle-click (or simultaneously click left and right mouse buttons, for those who have no middle button) and it will paste the selection. This is common behavior among terminal emulators.

Shellcat-Zero avatar Apr 15 '18 21:04 Shellcat-Zero

Would be nice to have it go to the system clipboard, and also be able to change paste behaviour to be paste on right click. I'd rather not wear out my much less durable middle-click for pasting (a common action)

tarfeef101 avatar Jun 20 '21 06:06 tarfeef101

I may be wrong on this but I do not think this has much to do with lxterminal itself. My understanding is that the 'selection' copy-buffer is different from the explicit copy/paste buffer by design. If you want it to go to the copy buffer, right-click and copy/paste (to be explicit).

FinboySlick avatar Jun 21 '21 17:06 FinboySlick

I may be wrong on this but I do not think this has much to do with lxterminal itself. My understanding is that the 'selection' copy-buffer is different from the explicit copy/paste buffer by design. If you want it to go to the copy buffer, right-click and copy/paste (to be explicit).

but... that IS to do with lxterminal itself. the decision was made to do something users don't all like. so giving users the CHOICE to have that behaviour, or to add to the system clipboard, and also paste on right click if they so desire, would be great. we linux because we like choice, after all

tarfeef102 avatar Jun 21 '21 17:06 tarfeef102

I agree that from a user's standpoint, it is lxterminal because the lxterminal window isn't behaving the way you want it to behave. That being said, there is no code in lxterminal to 'paste on middle-button'. The only code in lxterminal that listens to middle button events is the one to close tab. No decision was made by the LXDE team to 'copy on middle-click', and not a single line of code was written to do so.

Pasting with middle button is being done by the X server, lxterminal doesn't know anything about it. As far as lxterminal is concerned, you typed the pasted text with the keyboard. It is also the X server that assigns a separate clipboard to the selected text, which is called "Primary Selection" and that buffer is, by virtue of X11's design, separate from the "edit->copy" (system) buffer. Again, none of this is in lxterminal's code.

I am guessing that you are trying to get a behaviour similar to PuTTY and it makes sense, but what do you suggest we do with the right-click menu? Move it to middle-click, or maybe ctrl-right-click for people who have no middle button? We cannot reliably copy what PuTTY is doing and implement right-click on title-bar without overriding the window manager's decorations.

Furthermore, forcing an override of the 'normal' clipboard is something that requires careful thought because X11 assumes that the two clipboards are different.

Basically, linux is about giving users choice and users a long time ago decided to give you a choice between the system clipboard (using right-click->copy/paste or ctrl-c/ctrl-v) and the "Primary Selection" clipboard, using midle-click.

If you're willing to completely ignore the "Primary Selection" clipboard (which we have no control over) what you are asking for may be doable but it does imply a very unconventional override of the system clipboard on selection (which is probably breaking some standards) and still requires a solution for the right-click menu.

FinboySlick avatar Jun 21 '21 21:06 FinboySlick

@FinboySlick thank you for the overview. To summarize, there are two clipboards & methods of copy/paste:

  • Primary clipboard
    • Copy: Ctrl+C or right click, copy
    • Paste: Ctrl+V or right click, paste
  • X clipboard
    • Copy: Select
    • Paste: Middle click

Thus users who don't have a middle click (most laptop users) may want the ability to have two single user actions for copy then paste (one single user action for each).

As a result, if you're worried that select to primary/system clipboard by default is too destructive, can you consider a preference called "Copy selected text to system clipboard", allowing users to say that they want that behavior?

This would allow select to copy and ctrl+v to paste as a quick copy/paste. Not all single actions would be done by mouse, but they are both single actions that can be done easily & quickly by a laptop user!

Whether this should be a default can be discussed later, once people see how the preference behaves. It also separates the single user mouse action for paste (e.g. alternate right click) to a separate discussion.

WDYT?

rhinot avatar Dec 17 '21 19:12 rhinot

Okay I ignored this cause I was tied of internet debates, but I feel motivated again. here's what I'd like to see, which is entirely in the realm of the terminal application itself:

  • the option to copy to system clipboard on select
  • the option to right click to paste from the system clipboard
    • to address your concern, user choice is best. let the user rebind the right-click menu. macOS solves this with ctrl+right-click. I think that's a totally acceptable solution.

tarfeef101 avatar Dec 17 '21 19:12 tarfeef101

IMO, "Shift-Ctrl-C" and "Shift-Ctrl-V" for copying and pasting within lxterminal work well, and so far I have no use cases where automatic copying to the clipboard would be useful.

That said, if "automatic copy to the [system] clipboard on select" is adopted, I'd rather it was disabled by default on the "Advanced" tab.

davesp avatar Feb 11 '22 18:02 davesp

IMO, "Shift-Ctrl-C" and "Shift-Ctrl-V" for copying and pasting within lxterminal work well, and so far I have no use cases where automatic copying to the clipboard would be useful.

That said, if "automatic copy to the [system] clipboard on select" is adopted, I'd rather it was disabled by default on the "Advanced" tab.

i don't care if people have to enable it to have it work, but forcing keystrokes in addition to the action of mouse-selection is just enforcing a more complex/slower workflow.

and idk how/why people think middle-click is the solution to the world's problems. do you own mice? middle-clicks die, fast. the scroll wheel is not a durable component, it is not a button I want to be using with any sort of frequency.

tarfeef101 avatar Feb 14 '22 18:02 tarfeef101