all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: John F Carr <jfc@mit.edu>
Cc: 39399@debbugs.gnu.org
Subject: bug#39399: tramp depends on unstable details of shell command line processing
Date: Mon, 03 Feb 2020 09:58:26 +0100	[thread overview]
Message-ID: <87v9ooujwt.fsf@gmx.de> (raw)
In-Reply-To: <CE28E059-EC5A-4AA8-8452-6575D983FB7D@exchange.mit.edu> (John F. Carr's message of "Sun, 2 Feb 2020 21:28:40 +0000")

John F Carr <jfc@mit.edu> writes:

Hi John,

> I use emacs tramp mode for remote editing.  It stopped working on my
> FreeBSD systems when I upgraded to a development version.  The cause
> appears to be due to /bin/sh reprinting the entire line when a
> backspace is sent rather than sending only a backspace-space-backspace
> sequence.  The failure follows a change in the line editing library
> (shared with NetBSD) rather than the shell itself.
>
> Environment is emacs 24.5 or 26.3 running on Mac OS Catalina.  The
> remote system is FreeBSD 13.0 development.  Tramp works with Linux or
> FreeBSD 12.1 as the remote system.

Thanks a lot for your report! Since I'm not running FreeBSD anywhere, I
count on your support fixing the problem :-)

> Here's what happens.
>
> I load tramp and open a file like /ssh:user@host:/.  Emacs spawns ssh to connect.  The first thing tramp does is send
>
> stty -inlcr -onlcr -echo kill '^U' erase '^H'
>
> But this doesn't do much because the tty is in raw mode rather than
> cooked due to the shell's line editor.  So tramp falls back to a hack
> to detect echoed input.  It sends "_echo" followed by a string of
> backspace characters.  "_echo" is unlikely to appear in program
> output.
>
> Here is the next command after the initial stty:
>
> _echo^H^H^H^H^Hstty icanon erase ^H cols 32767_echo^H^H^H^H^H
>
> The groups of 5 ^H represent 5 backspace characters and the lone ^H in the middle is a two character sequence for stty.
>
> The terminal output from a 12.1 system is
>
> _echo^H ^H^H ^H^H ^H^H ^H^H ^Hstty icanon erase ^H cols 32767_echo^H ^H^H ^H^H ^H^H ^H^H ^H
> #$
>
> where again the middle ^H is a two character sequence and the others
> are backspace characters. There is a carriage return between the two
> lines.  "#$ " is the shell prompt set by tramp.

Well, and this works for years.

> The terminal output from a FreeBSD 13.0 development branch system is
>
> _echo
> #$ _ech ^H
> #$ _ec ^H
> #$ _e ^H
> #$ _ ^H
> #$  ^Hstty icanon erase ^H cols 32767_echo
> #$ stty icanon erase ^H cols 32767_ech ^H
> #$ stty icanon erase ^H cols 32767_ec ^H
> #$ stty icanon erase ^H cols 32767_e ^H
> #$ stty icanon erase ^H cols 32767_ ^H
> #$ stty icanon erase ^H cols 32767 ^H
> #$
>
> with carriage returns between lines.  This does not make sense to
> emacs, which hangs waiting for something it recognizes.  I can recover
> by hitting control-G which aborts the tramp connection.
>
> This issue is also reported to FreeBSD at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243807.

IIUC the discussion in that bug, it is due to the changed libedit of
FreeBSD 13. Hmm, don't know this beast. But wouldn't it help, if Tramps
sends initially "stty cooked"?

Best regards, Michael.





  reply	other threads:[~2020-02-03  8:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-02 21:28 bug#39399: tramp depends on unstable details of shell command line processing John F Carr
2020-02-03  8:58 ` Michael Albinus [this message]
2020-02-04  8:34   ` Michael Albinus
2020-02-05 23:42     ` John F Carr
2020-02-06  9:13       ` Michael Albinus
2020-07-27  4:12 ` 内藤 祐一郎
2020-07-27 18:01   ` Michael Albinus
2020-07-28  2:51     ` 内藤 祐一郎
2020-07-28  7:34       ` Michael Albinus

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

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

  git send-email \
    --in-reply-to=87v9ooujwt.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=39399@debbugs.gnu.org \
    --cc=jfc@mit.edu \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.