From cbf90e1621752bd5129abe0505072457893bfddc Mon Sep 17 00:00:00 2001 From: Jakukyo Friel Date: Thu, 31 Oct 2013 13:57:31 +0800 Subject: [PATCH] Fix a bug causeing `gist -c` fails for xsel users. Unlike `xclip`, calling `xsel` without any argument outputs the selection. In other words, `xclip` defaults to `xclip -i`, but xsel` defaults to `xsel -o`. Thus we should use `xsel -i` instead of `xsel` for copying the url to clipboard. --- build/gist | 2 +- lib/gist.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/gist b/build/gist index 7ac2168..097d0f9 100755 --- a/build/gist +++ b/build/gist @@ -1318,7 +1318,7 @@ module Gist # A list of clipboard commands with copy and paste support. CLIPBOARD_COMMANDS = { 'xclip' => 'xclip -o', - 'xsel' => 'xsel -o', + 'xsel -i' => 'xsel -o', 'pbcopy' => 'pbpaste', 'putclip' => 'getclip' } diff --git a/lib/gist.rb b/lib/gist.rb index 81d1756..3f6e6e5 100644 --- a/lib/gist.rb +++ b/lib/gist.rb @@ -12,7 +12,7 @@ module Gist # A list of clipboard commands with copy and paste support. CLIPBOARD_COMMANDS = { 'xclip' => 'xclip -o', - 'xsel' => 'xsel -o', + 'xsel -i' => 'xsel -o', 'pbcopy' => 'pbpaste', 'putclip' => 'getclip' }