Browse Source

Fixes bash permissions issue in Linux.

BDisp 4 years ago
parent
commit
286461e7c8
1 changed files with 8 additions and 3 deletions
  1. 8 3
      Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs

+ 8 - 3
Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs

@@ -1074,11 +1074,16 @@ namespace Terminal.Gui {
 
 
 		bool CheckSupport ()
 		bool CheckSupport ()
 		{
 		{
-			var result = BashRunner.Run ("which xclip");
-			if (string.IsNullOrEmpty (result) || result.Contains ("not found")) {
+			try {
+				var result = BashRunner.Run ("which xclip");
+				if (string.IsNullOrEmpty (result) || result.Contains ("not found")) {
+					return false;
+				}
+				return true;
+			} catch (Exception) {
+				// Permissions issue.
 				return false;
 				return false;
 			}
 			}
-			return true;
 		}
 		}
 
 
 		protected override string GetClipboardDataImpl ()
 		protected override string GetClipboardDataImpl ()