summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd2.py b/cmd2.py
index cbb98ec7..97160515 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -303,8 +303,13 @@ def options(option_list, arg_desc="arg"):
return option_setup
-# Can we access the clipboard?
+# Can we access the clipboard, always true on Windows and Mac, but only sometimes on Linux
can_clip = True
+if sys.platform == 'linux':
+ try:
+ pyperclip.paste()
+ except pyperclip.exceptions.PyperclipException:
+ can_clip = False
def get_paste_buffer():