Add support to ANSI OSC52 sequence to manipulate selection and clipboard
data. The sequence specs supports multiple clipboard selections but we
only support the common ones, system and primary clipboard selections.
This adds a new event listener to the common terminal module
`onClipboard` to allow external implementations to hook into it.
The addon uses the browser Clipboard API to read/write from and to the
clipboard. The default `ClipboardProvider` uses the browser Clipboard
API. This means it only supports read/write to and from the system
clipboard.
Reference: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands
Fixes: xtermjs#3260
Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
Harder than I thought for several reasons:
- need access to common to tests the subparts, thus the unified tsconfig
in tests does not work (need the path translation to those parts)
- moving next to src I cannot use direct imports anymore (source files
are out of rootDir), thus have to rely on d.ts files in out which is
quite suboptimal as many parts do not expose the declaration files
(can only type Terminal as any atm)
- compiler output has to resemble the '../out/..' import logic of the TS
files or require fails, thus moved the ouput to './benchmark' for now
Conclusion: Not yet there, maybe not a good idea at all to move those
tests out of './src' as they heavily rely on not exported internals.
Needs more fiddling with the repo structure.