unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Daniel Eklöf" <daniel@ekloef.se>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: Philipp Stephani <phst@google.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	36879@debbugs.gnu.org
Subject: bug#36879: 26.2; OSC 52 paste in term/xterm.el not working
Date: Sat, 03 Aug 2019 15:40:06 +0200	[thread overview]
Message-ID: <87o9169xl5.fsf@mini.la.casa> (raw)
In-Reply-To: <b05fc7a289ca608378a0b617bbfd9e5373883450.camel@acm.org>

> 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örresten, hej Mattias! Det var lite oväntat...)

--
Daniel





  parent reply	other threads:[~2019-08-03 13:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31 16:57 bug#36879: 26.2; OSC 52 paste in term/xterm.el not working Daniel Eklöf
2019-07-31 17:24 ` bug#36879: Daniel Eklöf
2019-08-03 11:41 ` bug#36879: 26.2; OSC 52 paste in term/xterm.el not working Mattias Engdegård
2019-08-03 11:52   ` Eli Zaretskii
2019-08-03 12:02     ` Mattias Engdegård
2019-08-03 12:08       ` Eli Zaretskii
2019-08-03 12:26         ` Mattias Engdegård
2019-08-03 13:36           ` Eli Zaretskii
2019-08-03 14:32             ` Mattias Engdegård
2019-08-03 16:59               ` Eli Zaretskii
2019-08-04  9:49                 ` Mattias Engdegård
2019-08-03 13:40   ` Daniel Eklöf [this message]
2019-08-03 13:49   ` Daniel Eklöf
2019-08-03 21:00   ` Stefan Monnier
2019-08-04  8:19     ` Daniel Eklöf
2019-08-04  9:44       ` Mattias Engdegård
2019-08-04 10:32         ` Daniel Eklöf
2019-08-04 12:47           ` Stefan Monnier
2019-08-15 19:32         ` Philipp Stephani
2019-08-15 21:28           ` Mattias Engdegård
2019-08-04 12:46       ` Stefan Monnier
2019-08-04 15:59         ` Daniel Eklöf
2019-08-05 11:41           ` Mattias Engdegård
2019-08-05 16:57             ` Daniel Eklöf
2019-08-08  9:37               ` Mattias Engdegård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o9169xl5.fsf@mini.la.casa \
    --to=daniel@ekloef.se \
    --cc=36879@debbugs.gnu.org \
    --cc=mattiase@acm.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=phst@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).