summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd2.py b/cmd2.py
index 87140ad4..3e36780b 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -398,11 +398,10 @@ else:
# Running on Linux
try:
with open(os.devnull, 'w') as DEVNULL:
- subprocess.check_call('xclip -o -sel clip', shell=True, stdin=subprocess.PIPE, stdout=DEVNULL,
- stderr=DEVNULL)
+ subprocess.check_call(['which', 'xclip'], stdout=DEVNULL, stderr=DEVNULL)
can_clip = True
except (subprocess.CalledProcessError, OSError, IOError):
- pass # something went wrong with xclip and we cannot use it
+ pass # xclip is not present, so we cannot use it
if can_clip:
def get_paste_buffer():
"""Get the contents of the clipboard for Linux OSes.