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

copy_on_selection does not copy to primary, messing up middle-button paste #980

Open
midgen42 opened this issue Jan 7, 2025 · 1 comment

Comments

@midgen42
Copy link

midgen42 commented Jan 7, 2025

The terminal.py Terminal.maybe_copy_clipboard method only uses self.vte.copy_clipboard.

As a result, while you can select text in a terminator terminal, it is not pasted elsewhere when you middle-click. I can select text in a gnome-terminal, and then middle-click in a terminator terminal and have it pasted. I would expect the same behavior when I select text in a terminator terminal and then middle-click.

It should be setup like Terminal.paste_clipboard and use primary or clipboard.

Changing maybe_copy_clipboard to use the below, makes everything work great:

def maybe_copy_clipboard(self):
  if self.config.........:
     if primary:
        self.vte.copy_primary()
     else:
        self.vte.copy_clipboard()
@mattrose
Copy link
Member

I've tried this but I just get an error when selecting. Can you be a little bit more specific with your example fix?

 File "/Users/mattrose/Code/terminator/terminatorlib/terminal.py", line 407, in maybe_copy_clipboard
    if primary:
       ^^^^^^^
NameError: name 'primary' is not defined

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

2 participants