Use -o when running xsel

xsel` without `-o` even though it has the same *end* result, has
different internal logic. Specifically, it seems to do things with the
PRIMARY selection that cause weird behaviour (like causing applications
like urxvt to deselect their selection, see #33).
This commit is contained in:
Chris Down 2016-11-05 12:05:22 -06:00
parent 3e50f9460a
commit c5f101d996

View file

@ -54,7 +54,7 @@ while sleep "${CLIPMENUD_SLEEP:-0.5}"; do
if type -p xsel >/dev/null 2>&1; then
debug 'Using xsel'
data=$(xsel --"$selection"; printf x)
data=$(xsel -o --"$selection"; printf x)
# Take ownership of the clipboard, in case the original application
# is unable to serve the clipboard request (due to being suspended,
# etc).
@ -63,7 +63,7 @@ while sleep "${CLIPMENUD_SLEEP:-0.5}"; do
# sometimes act up if clipboard focus is taken away from them --
# for example, urxvt will unhilight text, which is undesirable.
if [[ $selection != primary ]]; then
xsel --"$selection" | xsel -i --"$selection"
xsel -o --"$selection" | xsel -i --"$selection"
fi
else
debug 'Using xclip'