diff --git a/src/Consolonia.PlatformSupport/Clipboard/ClipboardProcessRunner.cs b/src/Consolonia.PlatformSupport/Clipboard/ClipboardProcessRunner.cs index 887f925a..e8a5f2bd 100644 --- a/src/Consolonia.PlatformSupport/Clipboard/ClipboardProcessRunner.cs +++ b/src/Consolonia.PlatformSupport/Clipboard/ClipboardProcessRunner.cs @@ -43,18 +43,17 @@ public static (int exitCode, string result) Process( { var output = string.Empty; - using var process = new Process + using var process = new Process(); + + process.StartInfo = new() { - StartInfo = new() - { - FileName = cmd, - Arguments = arguments, - RedirectStandardOutput = true, - RedirectStandardError = true, - RedirectStandardInput = true, - UseShellExecute = false, - CreateNoWindow = true - } + FileName = cmd, + Arguments = arguments, + RedirectStandardOutput = true, + RedirectStandardError = true, + RedirectStandardInput = true, + UseShellExecute = false, + CreateNoWindow = true }; // TaskCompletionSource eventHandled = new(); diff --git a/src/Consolonia.PlatformSupport/Clipboard/MacOSXClipboard.cs b/src/Consolonia.PlatformSupport/Clipboard/MacClipboard.cs similarity index 98% rename from src/Consolonia.PlatformSupport/Clipboard/MacOSXClipboard.cs rename to src/Consolonia.PlatformSupport/Clipboard/MacClipboard.cs index ead3a6d5..bf4e62da 100644 --- a/src/Consolonia.PlatformSupport/Clipboard/MacOSXClipboard.cs +++ b/src/Consolonia.PlatformSupport/Clipboard/MacClipboard.cs @@ -11,7 +11,7 @@ namespace Consolonia.PlatformSupport.Clipboard /// A clipboard implementation for MacOSX. This implementation uses the Mac clipboard API (via P/Invoke) to /// copy/paste. The existence of the Mac pbcopy and pbpaste commands is used to determine if copy/paste is supported. /// - internal class MacOSXClipboard : IClipboard + internal class MacClipboard : IClipboard { private readonly nint _allocRegister = sel_registerName("alloc"); private readonly nint _clearContentsRegister = sel_registerName("clearContents"); @@ -26,7 +26,7 @@ internal class MacOSXClipboard : IClipboard private readonly nint _utf8Register = sel_registerName("UTF8String"); private readonly nint _utfTextType; - public MacOSXClipboard() + public MacClipboard() { _utfTextType = objc_msgSend( objc_msgSend(_nsString, _allocRegister), diff --git a/src/Consolonia.PlatformSupport/Clipboard/WSLClipboard.cs b/src/Consolonia.PlatformSupport/Clipboard/WslClipboard.cs similarity index 97% rename from src/Consolonia.PlatformSupport/Clipboard/WSLClipboard.cs rename to src/Consolonia.PlatformSupport/Clipboard/WslClipboard.cs index 3cad6067..93931822 100644 --- a/src/Consolonia.PlatformSupport/Clipboard/WSLClipboard.cs +++ b/src/Consolonia.PlatformSupport/Clipboard/WslClipboard.cs @@ -11,12 +11,12 @@ namespace Consolonia.PlatformSupport.Clipboard /// to store the data, and uses Windows' powershell.exe (launched via WSL interop services) to set/get the Windows /// clipboard. /// - internal class WSLClipboard : IClipboard + internal class WslClipboard : IClipboard { private static string _powershellPath = string.Empty; private bool _isSupported; - public WSLClipboard() + public WslClipboard() { if (string.IsNullOrEmpty(_powershellPath)) { diff --git a/src/Consolonia.PlatformSupport/PlatformSupportExtensions.cs b/src/Consolonia.PlatformSupport/PlatformSupportExtensions.cs index 93400135..801be47b 100644 --- a/src/Consolonia.PlatformSupport/PlatformSupportExtensions.cs +++ b/src/Consolonia.PlatformSupport/PlatformSupportExtensions.cs @@ -45,17 +45,16 @@ public static AppBuilder UseAutoDetectedConsole(this AppBuilder builder) /// Provides cut, copy, and paste support for the OS clipboard. /// - /// On Windows, the class uses the Avalonia Windows Clipboard . + /// On Windows, we use the Avalonia Windows Clipboard . /// - /// On Linux, when not running under Windows Subsystem for Linux (WSL), the class X11 - /// PInvoke calls. + /// On Linux, when not running under Windows Subsystem for Linux (WSL), we use X11Clipboard to call X11 PInvoke calls. /// /// - /// On Linux, when running under Windows Subsystem for Linux (WSL), the class launches + /// On Linux, when running under Windows Subsystem for Linux (WSL), we use WslClipboard class launches /// Windows' powershell.exe via WSL interop and uses the "Set-Clipboard" and "Get-Clipboard" Powershell CmdLets. /// /// - /// On the Mac, the class uses the MacO OS X pbcopy and pbpaste command line tools and + /// On the Mac, we use MacClipboard class which uses the MacOS X pbcopy and pbpaste command line tools and /// the Mac clipboard APIs vai P/Invoke. /// /// @@ -73,12 +72,12 @@ public static AppBuilder UseAutoDetectClipboard(this AppBuilder builder) } else if (OperatingSystem.IsMacOS()) { - return builder.With(new MacOSXClipboard()); + return builder.With(new MacClipboard()); } else if (OperatingSystem.IsLinux()) { if (IsWslPlatform()) - return builder.With(new WSLClipboard()); + return builder.With(new WslClipboard()); else // alternatively use xclip CLI tool //return builder.With(new XClipClipboard());