From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Daniel =?UTF-8?Q?Ekl=C3=B6f?= Newsgroups: gmane.emacs.bugs Subject: bug#36879: 26.2; OSC 52 paste in term/xterm.el not working Date: Sat, 03 Aug 2019 15:40:06 +0200 Message-ID: <87o9169xl5.fsf@mini.la.casa> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="238828"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.2.0; emacs 26.2 Cc: Philipp Stephani , Stefan Monnier , 36879@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 03 15:41:08 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1htuHU-00101d-3t for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Aug 2019 15:41:08 +0200 Original-Received: from localhost ([::1]:40182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htuHT-0007n2-5Q for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Aug 2019 09:41:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40976) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htuHP-0007mc-KK for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2019 09:41:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1htuHO-0000xo-Kk for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2019 09:41:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49754) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1htuHO-0000xZ-Dl for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2019 09:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1htuHO-0004jF-BD for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2019 09:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel =?UTF-8?Q?Ekl=C3=B6f?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Aug 2019 13:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36879 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 36879-submit@debbugs.gnu.org id=B36879.156483961218108 (code B ref 36879); Sat, 03 Aug 2019 13:41:02 +0000 Original-Received: (at 36879) by debbugs.gnu.org; 3 Aug 2019 13:40:12 +0000 Original-Received: from localhost ([127.0.0.1]:58575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1htuGa-0004i0-K9 for submit@debbugs.gnu.org; Sat, 03 Aug 2019 09:40:12 -0400 Original-Received: from mail.ekloef.se ([193.105.134.189]:42374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1htuGY-0004hm-Dv for 36879@debbugs.gnu.org; Sat, 03 Aug 2019 09:40:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ekloef.se; s=mail; t=1564839606; bh=g0jQMjX7vQPNO1MEicxEMnX7OkcPHdXQVpxruo/EfTk=; h=References:From:To:Cc:Subject:In-reply-to:Date:From; b=PjdOvNPTGi6l2YQ2jAjgaD6I/h5NyPteSlo+d/aQ60fJsd5/9HPu6r8TDXI748CEt bfdSTgkZwxGrf0gQsHNHoYexfN9lG8mSf1fROEYv+8EqtYHhj32+fmRg4pynYigdz+ M/yryiCwnfnbruqcdaQZ0xQ6PfSxef5gmmt+gBk0BZbY79jjQQQskXX3NKAdIX4giW 0RkFTWpjbtfbz1zPv/9xtr9AUeixDeOsGbFYPEF4XE4E9ei+eVgG/SEYbEwZLqVB01 E6nUdbSTOie8qpqudNuCpy5UftW5FPJB1POSVnE7NbSqcJySepcN8bPloDiyQ88gg3 3UEerYUjkc7xw== In-reply-to: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:164453 Archived-At: > Emacs uses BEL (C-g) as INTR char, which means that not > only is special effort required to avoid having it quit the current > elisp code -- this could have been done using inhibit-quit -- but when > the pty receives the BEL from XTerm, it immediately discards unread > characters and raises SIGINT. I did figure Emacs, at the very least, handled BEL differently, but I wasn't aware the PTY would discard unread characters. Thanks for clarifying. > Thus, it's very much a race: the only way it could ever work would be > if Emacs has been able to read the entire reply except the BEL, and be > sitting inside (read-char) when the BEL reaches the pty. Needless to > say, this is rather unlikely. Never happened during my tests :) > Since XTerm parrots our choice of string terminator (BEL or ST), this > suggests a simpler solution: just use ST, and the trouble with BEL is > no more. Unfortunately the code has provisions for screen/tmux, where > the entire request is wrapped in a DCS request: > > ESC P ... ESC \ > > which means that we cannot use ST as terminator in that case. I came to the same conclusion, and wrote a proof-of-concept patch that replaced BEL with ST, and verified that yes, that does indeed work. In XTerm as well as in my not-fancy terminal. (I didn't bother removing support for screen though, making it both a broken patch, and cruder than yours :) ) (F=C3=B6rresten, hej Mattias! Det var lite ov=C3=A4ntat...) -- Daniel