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

Proper keyboard shortcut for copying content to CLIPBOARD #20

Open
Atemu opened this issue May 23, 2021 · 8 comments
Open

Proper keyboard shortcut for copying content to CLIPBOARD #20

Atemu opened this issue May 23, 2021 · 8 comments

Comments

@Atemu
Copy link

Atemu commented May 23, 2021

C-<insert> can be used to copy the selected text into the CLIPBOARD as expected but also prints ^[[2;5~ to the terminal which is annoying.

urxvt and xterm also do this, so I guess this is intentional?

Anyhow, it'd be very useful to have a proper C-c-like shortcut for copying text to CLIPBOARD, preferably configurable.

Related #19

@arakiken
Copy link
Owner

By default, mlterm copies the selected text into not only the PRIMARY but also the CLIPBOARD by selecting text without pressing
C-.
(--clip=false option disables this behavior.)
mlterm doesn't provide a way which copies the selected text into the CLIPBOARD without modifying the PRIMARY.

@Atemu
Copy link
Author

Atemu commented Jun 13, 2021

I see, thank you.

mlterm doesn't provide a way which copies the selected text into the CLIPBOARD without modifying the PRIMARY.

Which makes sense when you think about it because, even if it had a key for that, you still couldn't do that because you'd always have to select the text before copying it anyways.

Copying previously highlighted text after you copied text in another application would be a case where that doesn't apply but mlterm deselects highlighted text when another application takes control of the clipboard. That makes perfect sense in this model but is also a bit odd and unusual (most other programs and terminal emulators don't behave like that).

@xerostomus
Copy link

xerostomus commented Sep 8, 2023

I generally have problems with shortcuts:
Shift-Control-Return - does the same as Return/Enter
Ctrl-shift-c is breaking editing the current line as ^C and it is the only way how to copy into clipboard
Ctrl-insert prints ~5 or what
Shift-inserts properly the content of clipboard

Am I doing something wrong?
It is quite unusable this way...
Unfortunately...

I have installed lxterminal recently and it is not doing it. Properly works - ctrl-shift-C/V.
I would recommend to copy their code if possible and afterwards to thank them a lot for the inspiration - of course. :-)

jk

@Atemu
Copy link
Author

Atemu commented Sep 9, 2023

As @arakiken mentioned, there currently is no copy shortcut because mlterm always copies selected text. If you select some text, it's already "copied".

I'm personally of the opinion that this goes against the principle of least surprise because, ordinarily, programs put selected text into PRIMARY and only put text into CLIPBOARD upon pressing a specific "copy" shortcut.

@xerostomus
Copy link

xerostomus commented Sep 10, 2023

Dear Atemu,
I will try to demonstrate:

 jk@T430:~$ : I want to copy this: "SELECTION"
 jk@T430:~$ : I am editing this line, selecting SELECTION, pressing ctrl+shift+c ^C
 jk@T430:~$ : Editing is broken, but in the clipboard is:
 jk@T430:~$ xsel -b -o # this is in the cliboard
 "SELECTION"

I do not want to have my editing broken after ctrl+shift+c. I want mlterm only to copy SELECTION.
Is it clear? :-)

Thanks

jk

@xerostomus
Copy link

Dear Atemu,

I finally understand the idea.

mlterm is continuously changing my clipboard whenever I only select some text.
It is a big surprise to me. Now I see this strange behaviour:

If I do some work in Libreoffice, copy with CTRL-C into clipboard say "LibreofficeSelection", then I go into mlterm. I can paste LibreofficeSelection by shift+instert. This is ok.
I select something say "mltermSelection" then it disappears in LibreofficeSelection, I can paste in mltermSelection in mlterm, but i cannot paste nothing in Libreoffice: either LibreofficeSelection no mltermSelection, as it was errased by selecting in mlterm.

It is very curious behavior. Do you intent it should behave like that?
JK

@arakiken
Copy link
Owner

Thanks for your report.
I fixed this issue. -> f275093

mlterm doesn't change clipboard by selecting text unless Shift+Control+c is pressed.
In addition, pressing Shift+Control+v pastes text from clipboard.
These shortcut keys are configurable in ~/.mlterm/key. (See f275093#diff-9442419d3f753347a514b3af47087210c95a76a2a575751fae17b03db8a5c33b )

@xerostomus
Copy link

Thank you, Arakiken & Atemu,

nice piece of code...
:-)

JK

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

3 participants