Tags: avih/uclip
Tags
copy (win32): clear the clipboard using win32 API It seems that some (winRT?) applications don't identify the copy unless the clipboard is cleared first. See: - microsoft/terminal#14323 - microsoft/terminal#14323 (comment) Commit 46f2f42 already added a dotnet clear (before the win32 copy), but apparently that's not always enough for the Windows terminal. Clearing using the win32 EmptyClipboard() does seem to work for the Windows terminal. The dotnet clear is now only invoked if the win32 copy failed. It's unclear whether it's required, because the Windows Terminal does paste successfully when copying using dotnet even without clear, but keep it just in case.
copy empty text: clear the clipboard instead of error (v0.2)
Apparently Clipboard.SetText("") throws an exception, which affected
-c/-i/-I.
Now it instead clears the clipboard, which is semantically consistent
with setting the clipboard text to an empty string.