Problem Description
In Linux, clipboard.write() can report success silently despite there being no clipboard utility at all.
Causes of the problem
- The actual method used for writing into clipboard throws an exception which is silenced with
.catch(() => undefined) (for osascript, wl-copy, xclip, xsel or clipboardy)
- OSC52 fails silently if stdout is not a TTY
- There is no verification —
write() returns Promise<void>
Desired Solution
The calling code should get some indication of whether copying has happened or not.
Failed copy methods should not be silently ignored.
Copying through OSC52 should not silently fail.
Environment where the problem occurs
- Linux (doesn't depend on particular distribution)
- Terminal that doesn't have OSC52 functionality and/or has no clipboard utilities
Problem Description
In Linux,
clipboard.write()can report success silently despite there being no clipboard utility at all.Causes of the problem
.catch(() => undefined)(forosascript,wl-copy,xclip,xselorclipboardy)write()returnsPromise<void>Desired Solution
The calling code should get some indication of whether copying has happened or not.
Failed copy methods should not be silently ignored.
Copying through OSC52 should not silently fail.
Environment where the problem occurs