fanglingsu / vimb

Vimb - the vim like browser is a webkit based web browser that behaves like the vimperator plugin for the firefox and usage paradigms from the great editor vim. The goal of vimb is to build a completely keyboard-driven, efficient and pleasurable browsing-experience.
https://fanglingsu.github.io/vimb/
GNU General Public License v3.0
1.35k stars 100 forks source link

Yank lost on exit #626

Closed samhh closed 3 years ago

samhh commented 4 years ago
Version:         3.6.0
WebKit compile:  2.26.2
WebKit run:      2.28.4
GTK compile:     3.24.13
GTK run:         3.24.21
libsoup compile: 2.68.3
libsoup run:     2.70.0
Extension dir:   /usr/lib/vimb

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:

iamleot commented 4 years ago

Hello Sam,

Sam A. Horvath-Hunt writes:

[...]

  • command_yank in src/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 anxclip' process active for every possible stored selection, if you kill the xclip process the selection will get lost as well).

samhh commented 4 years ago

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.

fanglingsu commented 4 years ago

@samhh I fear there is nothing we can do from within vimb to keep the clipboard content accessible after the vimb process was terminated.

samhh commented 4 years ago

Understood. Anything we can do from outside of it as users? I can't get autocutsel to work with vimb.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had activity within the last 60 days.

fanglingsu commented 3 years ago

I close this because it the way X11 handles clipboards.