Closed samhh closed 3 years ago
Hello Sam,
Sam A. Horvath-Hunt writes:
[...]
command_yank
insrc/command.c
says in a comment block that it will try to set PRIMARY and CLIPBOARD - it is my understanding that the latter shouldn't be lost on app closure, but I might be mistaken - X's approach to clipboards really confuses me. [...]
Yes, when an X11 window is closed, related primary/secondary/clipboard selections get lost with them. In other words, that's not a vimb bug but how the X11 selections works).
As a possible way to solve that you can e.g. xclip -o | xclip -i' the selection (and you can notice that there will be an
xclip' process
active for every possible stored selection, if you kill the xclip
process the selection will get lost as well).
Ah, I did worry it was my misunderstanding X's clipboard story. Any way to automate the syncing of the clipboard with autocutsel? It doesn't seem to work with vimb.
@samhh I fear there is nothing we can do from within vimb to keep the clipboard content accessible after the vimb process was terminated.
Understood. Anything we can do from outside of it as users? I can't get autocutsel to work with vimb.
This issue has been automatically marked as stale because it has not had activity within the last 60 days.
I close this because it the way X11 handles clipboards.
Steps to reproduce
Open vimb and yank something (e.g. URL with
y
). Observe the difference in behaviour before and after exiting.Expected behaviour
Prior to exiting, you'll get your yanked text at all of the following:
xclip -o -selection clipboard
xclip -o -selection primary
xclip -o -selection buffer-cut
Actual behaviour
After exiting, the yanked text is only available in the third of the three.
It is my suspicion that this is a bug on the basis of:
autocutsel -selection PRIMARY -debug -verbose
showssel -> cut
, whereas for example yanking to the system clipboard in vim yieldscut -> sel
. (Is there a better way to debug clipboards?)command_yank
insrc/command.c
says in a comment block that it will try to set PRIMARY and CLIPBOARD - it is my understanding that the latter shouldn't be lost on app closure, but I might be mistaken - X's approach to clipboards really confuses me.