Browse Source

Trying even more to fix permissions issue and removed try catch.

BDisp 4 years ago
parent
commit
30748df0da

+ 1 - 5
Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs

@@ -1109,11 +1109,7 @@ namespace Terminal.Gui {
 			// 	System.IO.File.Delete (tempFileName);
 			// }
 
-			try {
-				BashRunner.Run ("xclip -selection clipboard -i", false, text);
-			} catch (Exception ex) {
-				throw new NotSupportedException ("Write to clipboard failed", ex);
-			}
+			BashRunner.Run ("xclip -selection clipboard -i", false, text);
 		}
 	}
 

+ 5 - 1
UnitTests/ClipboardTests.cs

@@ -64,7 +64,11 @@ namespace Terminal.Gui.Core {
 			Application.Init (new FakeDriver (), new FakeMainLoop (() => FakeConsole.ReadKey (true)));
 
 			var clipText = "Trying to set the OS clipboard.";
-			Assert.True (Clipboard.TrySetClipboardData (clipText));
+			if (Clipboard.IsSupported) {
+				Assert.True (Clipboard.TrySetClipboardData (clipText));
+			} else {
+				Assert.False (Clipboard.TrySetClipboardData (clipText));
+			}
 
 			Application.Iteration += () => Application.RequestStop ();