martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.19k stars 259 forks source link

vis-clipboard: make xsel honor --selection #1050

Closed njhanley closed 1 year ago

njhanley commented 1 year ago

vis-clipboard currently ignores the --selection option when wrapping xsel because the flag -b (use clipboard selection) is passed afterward, overriding the choice. For example:

$ echo unset | xsel --clipboard
$ echo unset | xsel --primary
$ echo clipboard | vis-clipboard --copy --selection clipboard
$ echo primary | vis-clipboard --copy --selection primary
$ xsel --clipboard
primary
$ xsel --primary
unset
mcepl commented 1 year ago

LGTM

Merged into https://git.sr.ht/~mcepl/vis/log/master but given I don’t use Xorg, I can vouch for not making it mess anywhere else.

rnpnr commented 1 year ago

This is correct. -b forces xsel to copy to the CLIPBOARD selection which overrides the previous --"$sel" flag.