Stefan Monnier <
address@hidden> schrieb am Mon Feb 09 2015 at 5:23:09 AM:
> It’s a nice feature but be aware that most DE-specific X-based
> terminal emulators (GNOME, Xfce, Konsole, …) do not implement it and
> still advertise themselves as TERM=xterm[-256color].
Right, the code needs to be able to handle the situation where the
underlying terminal emulator doesn't support the feature.
There are typically 2 situations:
- the terminal emulator just ignores the special codes we send, so we
can happily delude ourselves into thinking they always work.
- we check the terminal version info before enabling/using the feature
(see xterm--version-handler in lisp/xterm.el).
It seems the first option won't work here, since we may send large
chunks of text as clipboard contents, which are unlikely to be
silently ignored.
http://invisible-island.net/xterm/xterm.log.html#xterm_203 says "add experimental option to allow applications to get or set the selection data as a BASE64 string (adapted from patch by Joe Allen)." I assume this is the OSC 52 functionality, so setting 203 as the minimum requirement sounds like a reasonable choice. On my Ubuntu 14.04 box I found the following version strings reported:
hterm: "0;256;0"
xterm: "41;297;0"
gnome-terminal: "1;3409;0"
gnome-terminal gets adjusted to 200, so I assume that the test for >= 203 should be OK and cover both xterm and hterm.