From 478d10384f200f629dcb2091cadf255664807eee Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Mon, 3 Apr 2023 20:57:34 -0400 Subject: [PATCH] Clear X11 clipboard with 'printf', rather than the less standard 'echo -n' Former-commit-id: d6f994d9b0edd9aa333dcb76c34a15c26a3631b2 Former-commit-id: ad5858bbdcafec5be890e801938a0fb8f6df8a9c --- lib/sshyp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index 7c8674d..f75c0c1 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -710,8 +710,8 @@ def copy_data(): # copies a specified field of an entry to the clipboard run(['termux-clipboard-set', _copy_line[_index].rstrip()]) Popen("sleep 30; termux-clipboard-set ''", shell=True) else: # X11 clipboard detection - run(['xclip', '-sel', 'c'], stdin=Popen(['echo', '-n', _copy_line[_index].rstrip()], stdout=PIPE).stdout) - Popen("sleep 30; echo -n '' | xclip -sel c", shell=True) + run(['xclip', '-sel', 'c'], stdin=Popen(['printf', _copy_line[_index].rstrip()], stdout=PIPE).stdout) + Popen("sleep 30; printf '' | xclip -sel c", shell=True) rmtree(f"{tmp_dir}{_shm_folder}")