commit 48dce54b756ce2e329d918a60a2d6b5b15cb9369
parent f3badd8f3558fd152cac91d32562717a00b5066c
Author: Chris Down <chris@chrisdown.name>
Date: Thu, 10 May 2018 17:16:28 +0100
Merge branch 'release/5.4.0'
Diffstat:
3 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/clipmenu b/clipmenu
@@ -68,5 +68,5 @@ if ! [[ -f "$file" ]]; then
fi
for selection in clipboard primary; do
- xsel --logfile /dev/stderr -i --"$selection" < "$file"
+ xsel --logfile /dev/null -i --"$selection" < "$file"
done
diff --git a/clipmenud b/clipmenud
@@ -21,19 +21,8 @@ has_clipnotify=0
# shellcheck disable=SC2206
cm_selections=( $CM_SELECTIONS )
-
-xsel_log=/dev/null
-for file in /proc/self/fd/2 /dev/stderr; do
- [[ -f "$file" ]] || continue
- # In Linux, it's not possible to write to a socket represented by a file
- # (for example, /dev/stderr or /proc/self/fd/2). See issue #54.
- [[ -f "$(readlink -m "$file")" ]] || continue
- xsel_log="$file"
- break
-done
-
_xsel() {
- timeout 1 xsel --logfile "$xsel_log" "$@"
+ timeout 1 xsel --logfile /dev/null "$@"
}
get_first_line() {
diff --git a/tests/test-clipmenu b/tests/test-clipmenu
@@ -81,8 +81,8 @@ grep -Fxq 'dmenu line 1 stdin: Selected text 2. (2 lines)' "$temp"
grep -Fxq 'dmenu line 2 stdin: Selected text. (2 lines)' "$temp"
# xsel should copy both to clipboard *and* primary
-grep -Fxq 'xsel args: --logfile /dev/stderr -i --clipboard' "$temp"
-grep -Fxq 'xsel args: --logfile /dev/stderr -i --primary' "$temp"
+grep -Fxq 'xsel args: --logfile /dev/null -i --clipboard' "$temp"
+grep -Fxq 'xsel args: --logfile /dev/null -i --primary' "$temp"
grep -Fxq 'xsel line 1 stdin: Selected text.' "$temp"
grep -Fxq "xsel line 2 stdin: Yes, it's selected text." "$temp"