1

I'm using xfce4-terminal with the setting enabled: "Automatically copy selection to clipboard"

It works fine when select something, the selection is copied to clipboard. But if I close the terminal window, the clipboard becomes empty. It doesn't matter how I close it, by menu or by hotkey.

And the terminal only clears the content copied from itself. I tried copy some text from Chrome Browser, then close the terminal, the clipboard content is still there.

Why is that? How to keep the clipboard content when close the terminal?

Environment: Kali Linux, xfce

Edit:

Just learned from comments, it seems to be the syncing problem between PRIMARY and CLIPBOARD. I tried tools form other site that works for them, but not work for me:

  1. parcellite

    Right click -> Preferences -> Synchronize clipboards

    Doeas not work at all.

  2. autocutsel

    autocutsel -fork -selection CLIPBOARD -debug -verbose
    autocutsel -fork -selection PRIMARY -debug -verbose
    

    The debug output is correct when selecting text in terminal, but not synced to CLIPBOARD, don't know where it synced to.

  3. xfce4-clipman:

    Right click -> Properties -> Sync mouse selections

    It works for syncing, the problem is that it syncs mouse selection from everywhere, not only from terminal, even with the option "Ignore mouse selections" checked.

11
  • 3
    Probably this: "It is also important to realize that according to the selection protocols, nothing is copied until it is pasted. For example, if you select some word in a terminal window, close the terminal and then want to paste it somewhere else, it will not work because the terminal is gone and the text has not been copied anywhere." Dec 4, 2021 at 14:46
  • 2
    Does this answer your question? Who stores copy/paste buffers in X11? Dec 4, 2021 at 15:04
  • @StephenKitt, that explains how the "cut-buffers" or "PRIMARY" works: by interacting with XServer, but I still can't find a solution.
    – aj3423
    Dec 4, 2021 at 17:28
  • 1
    @aj3423 you seem to have run off in some other direction - syncing PRIMARY and CLIPBOARD have nothing to do with the problem here. The problem is that "copying" something is only an indication to the X system that something is available to paste. No data is saved or transferred anywhere until a paste occurs. If you close the source application before the paste happens, well, then, there's nothing to paste from.
    – muru
    Dec 6, 2021 at 11:02
  • 1
    @aj3423 are you sure you don’t have another Chrome window open somewhere? On my system, content copied in Chrome isn’t available after Chrome exits. Dec 6, 2021 at 15:40

0

You must log in to answer this question.

Browse other questions tagged .