diff --git a/Terminal.Gui/Core/Clipboard/Clipboard.cs b/Terminal.Gui/Core/Clipboard/Clipboard.cs index e7d570074..60c915dc9 100644 --- a/Terminal.Gui/Core/Clipboard/Clipboard.cs +++ b/Terminal.Gui/Core/Clipboard/Clipboard.cs @@ -14,14 +14,20 @@ namespace Terminal.Gui { public static ustring Contents { get { try { - return Application.Driver.Clipboard.GetClipboardData (); + if (IsSupported) { + return Application.Driver.Clipboard.GetClipboardData (); + } else { + return contents; + } } catch (Exception) { return contents; } } set { try { - Application.Driver.Clipboard.SetClipboardData (value.ToString ()); + if (IsSupported) { + Application.Driver.Clipboard.SetClipboardData (value.ToString ()); + } contents = value; } catch (Exception) { contents = value; diff --git a/UICatalog/Scenarios/Editor.cs b/UICatalog/Scenarios/Editor.cs index 507d67e98..50ba22571 100644 --- a/UICatalog/Scenarios/Editor.cs +++ b/UICatalog/Scenarios/Editor.cs @@ -75,6 +75,7 @@ namespace UICatalog { new StatusItem(Key.F2, "~F2~ Open", () => Open()), new StatusItem(Key.F3, "~F3~ Save", () => Save()), new StatusItem(Key.CtrlMask | Key.Q, "~^Q~ Quit", () => Quit()), + new StatusItem(Key.Null, $"OS Clipboard IsSupported : {Clipboard.IsSupported}", null) }); Top.Add (statusBar);