From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: X selection access in xterm (OSC 52) Date: Mon, 09 Feb 2015 16:05:04 +0000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0122e992fbc520050ea9eebf X-Trace: ger.gmane.org 1423497927 2893 80.91.229.3 (9 Feb 2015 16:05:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Feb 2015 16:05:27 +0000 (UTC) Cc: Emacs developers To: Stefan Monnier , Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 09 17:05:26 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YKqpx-0002J0-LV for ged-emacs-devel@m.gmane.org; Mon, 09 Feb 2015 17:05:26 +0100 Original-Received: from localhost ([::1]:33601 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKqpx-0003pA-4x for ged-emacs-devel@m.gmane.org; Mon, 09 Feb 2015 11:05:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKqpf-0003lO-C4 for emacs-devel@gnu.org; Mon, 09 Feb 2015 11:05:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKqpe-0007lW-5D for emacs-devel@gnu.org; Mon, 09 Feb 2015 11:05:07 -0500 Original-Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:57850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKqpd-0007kn-VA for emacs-devel@gnu.org; Mon, 09 Feb 2015 11:05:06 -0500 Original-Received: by mail-wg0-f52.google.com with SMTP id z12so6252060wgg.11 for ; Mon, 09 Feb 2015 08:05:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:from:date:message-id:subject:to:cc :content-type; bh=0dsLAqYnVLelocar6ANLl+8O+OZMmJsWc+4zfh44m6w=; b=HAeuaGDg5WNoSDkQK5REPWSHh143/bzA6yP8MNrFlqF8Jey+JgPrZliG0n3GtNyDSS EbKBt4wZ0YeufNO9RpJFddz6Pt4EMK9dUAo8LylCCMn+/gzq6wwyzWHb9Nj6Y7zyARl8 ZjYM3ClIWqgNkPYTi6qI3Nmo1VXI661oxrKaLECNER+vbRNxVlhkesv7Dbdx95f7C6xI MmEC3wg+kYlGmes5dgVHnGxE+yo/1qUCFpZ/hm662posP/ZFMeuPepPTFvZ53bgDge8G VXgLlF14snDAEQDHs3WrQc/gWZPGCxkcDVOs0V0KxzPtsQewkZAY43uzvOY8M7jf0IqV hjSA== X-Received: by 10.194.156.133 with SMTP id we5mr2029281wjb.37.1423497905290; Mon, 09 Feb 2015 08:05:05 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182703 Archived-At: --089e0122e992fbc520050ea9eebf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Stefan Monnier schrieb am Mon Feb 09 2015 at 5:23:09 AM: > > It=E2=80=99s a nice feature but be aware that most DE-specific X-based > > terminal emulators (GNOME, Xfce, Konsole, =E2=80=A6) do not implement i= t and > > still advertise themselves as TERM=3Dxterm[-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 >=3D 203 should be OK and cover both xterm and hterm. --089e0122e992fbc520050ea9eebf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Stefan Monnier <monnier@iro.umontreal.ca> sc= hrieb am Mon Feb 09 2015 at 5:23:09 AM:
&= gt; It=E2=80=99s a nice feature but be aware that most DE-specific X-based<= br> > terminal emulators (GNOME, Xfce, Konsole, =E2=80=A6) do not implement = it and
> still advertise themselves as TERM=3Dxterm[-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
=C2=A0 can happily delude ourselves into thinking they always work.
- we check the terminal version info before enabling/using the feature
=C2=A0 (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 a= llow applications to get or set the selection data as a BASE64 string (adap= ted from patch by Joe Allen)." I assume this is the OSC 52 functionali= ty, so setting 203 as the minimum requirement sounds like a reasonable choi= ce. On my Ubuntu 14.04 box I found the following version strings reported:<= /div>

hterm: "0;256;0"
xterm: &= quot;41;297;0"
gnome-terminal: "1;3409;0"

gnome-terminal gets adjusted to 200, so I assume tha= t the test for >=3D 203 should be OK and cover both xterm and hterm.
--089e0122e992fbc520050ea9eebf--