From f421c8fcf3c47c78c666906165006969ff21429e Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 27 Feb 2025 11:38:42 +0300 Subject: implemented ncurses clipboard support via external processes * As an alternative to OSC-52, which is rarely supported by terminal emulators. * Makes the new mouse support much more useful since you rely on good builtin clipboard support. You can no longer e.g. just double-click a word to copy it into the "primary" selection as terminal emulators do by default. * Set $SCITECO_CLIPBOARD_SET/GET e.g. to xclip, way-copy, pbcopy or some wrapper script. * This is currently using POSIX-specific popen() API, so it behaves a bit different to command execution via EC/EG. I am not sure if it's worth rewriting with the GSpawn-API, since it will be used only on POSIX anyway and a GSpawn-based implementation is likely to be a bit larger. * Should there be some small command-line utility for interacting (esp. pasting) via OSC-52, built-in OSC-52 support could well be removed from SciTECO. Currently, I know only of https://github.com/theimpostor/osc/ and it requires very recent Go compilers. (I still haven't tested it. Quite possibly, pasting when run as a piped command is impossible.) --- sample.teco_ini | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sample.teco_ini') diff --git a/sample.teco_ini b/sample.teco_ini index 0debdcc..13ab76b 100644 --- a/sample.teco_ini +++ b/sample.teco_ini @@ -62,9 +62,13 @@ EMQ[$SCITECOPATH]/fnkeys.tes !* Comment out to disable mouse interaction on Curses *! 0,64ED -!* Uncomment if terminal supports OSC-52 clipboards *! +!* Uncomment if terminal emulator supports OSC-52 clipboards *! !!0,256ED +!* For integrating with xclip on ncurses *! +[$SCITECO_CLIPBOARD_SET]xclip -in -selection {} +[$SCITECO_CLIPBOARD_GET]xclip -out -selection {} || true + !* Uncomment to enable Unicode icons in the Curses UI *! !!0,512ED -- cgit v1.2.3