GNU bug report logs - #28139
25.2; TRAMP vs bash 4.4 / readline 7.0 "bracketed paste" mode

Previous Next

Package: emacs;

Reported by: Daniel Pittman <slippycheeze <at> google.com>

Date: Fri, 18 Aug 2017 15:34:01 UTC

Severity: normal

Found in version 25.2

Fixed in version 26.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Daniel Pittman <slippycheeze <at> google.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 28139 <at> debbugs.gnu.org
Subject: bug#28139: 25.2; TRAMP vs bash 4.4 / readline 7.0 "bracketed paste" mode
Date: Mon, 13 Nov 2017 14:41:30 -0500
[Message part 1 (text/plain, inline)]
Michael, you are completely right that my previous change was not
necessary.  I blame my prehistoric knowledge of Emacs here, as I wasn't
aware of the change to use INSIDE_EMACS.  On testing, it seems that EMACS=t
just happened to work in bash (for legacy reasons, probably other dinosaurs
like me), and INSIDE_EMACS also disables editing, and fixes my problem.

You are also quite correct that INSIDE_EMACS was being set by tramp.  The
problem was that it was set at the wrong time: we need it set *before* we
start the shell, to disable readline bracketed paste (and other advanced
features) before we start, for example, interrogating the remote system for
the running version with `uname` during `tramp-open-shell`.

I have attached a patch that moves two variables, TERM and INSIDE_EMACS,
out of `tramp-remote-process-environment`, and instead, handles setting
them prior to shell execution.

This has two advantages:

First, INSIDE_EMACS is visible to the shell we are about to probe for
usability, which fixes my own problem with bracketed paste support in
libreadline / bash breaking, and which makes it uniformly available on the
remote host.

Second, changes to `tramp-terminal-type` (and the TRAMP version) are now
handled correctly without having to recompute the value of
`tramp-remote-process-environment`; previously this was not done, and a
restart or user intervention would be required to correct them.

Hopefully this meets with approval, so I append both the patch, and what I
think is the appropriate changelog entry for this, to be manually added:

2017-11-13  Daniel Pittman  <slippycheeze <at> google.com>

* tramp-sh.el: Set TERM and INSIDE_EMACS environment earlier.
(tramp-remote-process-environment): Remove TERM and INSIDE_EMACS.
(tramp-remote-process-environment): Document their special handling.
(tramp-open-shell): Set TERM and INSIDE_EMACS prior to starting the
initial remote shell, so that it is also aware of the environment
in which it is operating.
[Message part 2 (text/html, inline)]
[emacs-tramp-no-editing.patch (application/octet-stream, attachment)]

This bug report was last modified 7 years and 283 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.