[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: X selection access in xterm (OSC 52)

From: Philipp Stephani
Subject: Re: X selection access in xterm (OSC 52)
Date: Mon, 09 Feb 2015 16:05:04 +0000

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]