unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: "Daniel Eklöf" <daniel@ekloef.se>
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: Sun, 4 Aug 2019 11:44:27 +0200	[thread overview]
Message-ID: <5E410D26-8917-4291-8202-C28FAE1CD0B2@acm.org> (raw)
In-Reply-To: <877e7tqr5w.fsf@mini.la.casa>

4 aug. 2019 kl. 10.19 skrev Daniel Eklöf <daniel@ekloef.se>:
> 
> set-selection has always worked, at least for me. That one is also enabled by default in xterm.el (when an xterm supporting it is detected, I assume).

Right, it lacks the technical problems of the copy-from-clipboard direction, since no reply from the terminal is involved.

> I'm probably missing something obvious, but how is talking to xclip more secure than talking to the terminal emulator? Or is the "security perspective" somewhere else?

It's not a problem in Emacs, but by enabling OSC 52 in your terminal, an adversary might arrange for a crafted string to be sent to it which would surreptitiously inject malicious data into the clipboard, or extract secrets from it. The OSC 52 reply itself could cause damage under some circumstances, or the attacker could just hope for the victim to paste a command into a shell prompt.

> Except that xclip assumes x11. Would it not make sense to support a window protocol agnostic method? By supporting OSC 52, you support whatever clipboard mechanism the terminal emulator supports.

I can definitely see how OSC 52 can be useful when there is only a terminal connection to the machine running Emacs, and no out-of-band conduit for the clipboard. The user needs to enable it actively both in the terminal and in Emacs; it cannot be used by accident.

> Perhaps one could use the heavy weight solution (change quit char) when 'screen' is detected, but simply use ST in the non-screen case?

The thought did cross my mind, but I thought I'd first enquire about the screen usage, given that I only got it to work with screen, not tmux, and then only after explicitly setting TERM.

Perhaps Philipp Stephani who originally wrote the code could help us here (sorry about dragging you into the discussion, Philipp). Under what circumstances did you run it? (It was 4 years ago; it's understandable if you don't remember much of it.)







  reply	other threads:[~2019-08-04  9:44 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
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 [this message]
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=5E410D26-8917-4291-8202-C28FAE1CD0B2@acm.org \
    --to=mattiase@acm.org \
    --cc=36879@debbugs.gnu.org \
    --cc=daniel@ekloef.se \
    --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).