From owner-freebsd-bugs@freebsd.org Sun Feb 2 16:42:08 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57FE1233556 for ; Sun, 2 Feb 2020 16:42:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 489cDw1l71z4N0T for ; Sun, 2 Feb 2020 16:42:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 3BC35233555; Sun, 2 Feb 2020 16:42:08 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B8C6233554 for ; Sun, 2 Feb 2020 16:42:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 489cDw0tJQz4N0S for ; Sun, 2 Feb 2020 16:42:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19B891ABF8 for ; Sun, 2 Feb 2020 16:42:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 012Gg7mp040217 for ; Sun, 2 Feb 2020 16:42:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 012Gg7gQ040216 for bugs@FreeBSD.org; Sun, 2 Feb 2020 16:42:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 243807] CURRENT libedit breaks emacs tramp-mode Date: Sun, 02 Feb 2020 16:42:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jfc@mit.edu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Feb 2020 16:42:08 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D243807 Bug ID: 243807 Summary: CURRENT libedit breaks emacs tramp-mode Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: jfc@mit.edu Emacs tramp-mode uses ssh to move data and commands back and forth to use a local emacs to edit remote files. It no longer works when the remote syste= m is running FreeBSD CURRENT. The problem is apparently caused by the new versi= on of libedit. Running 12.1 in a jail on CURRENT works, but copying in the CURRENT version of libedit reintroduced the problem. I suspect this will turn out to be undesirable behavior that is not strictly speaking a bug, but the current behavior is suboptimal for reasons other th= an breaking tramp mode. Emacs tramp mode opens an ssh connection to a remote machine. It doesn't w= ant to see input echoed back so it runs stty -inlcr -onlcr -echo kill '^U' erase '^H' This doesn't do anything useful if a shell is running in line editing mode (raw) instead of using the tty (cooked). 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 #$=20 where again the middle ^H is a two character sequence and the others are control characters. There is a carriage return between the two lines. "#$ = " is the shell prompt set by tramp. The terminal output from a CURRENT 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 #$=20 with carriage returns between lines. This does not make sense to emacs. (= And it is the suboptimial behavior I mentioned above, doing much more terminal output than necessary.) I tried both /bin/sh and /bin/csh as shells and tramp didn't work with eith= er.=20 I put set +V and set +E in my .profile thinking that would turn off line editing but there was no change. Probably the shell still takes raw input through libedit even if vi and emacs style editing are off. I browsed the large diff between 12 and head versions of libedit and didn't= see anything obvious. I don't have a NetBSD system to test on. (NetBSD is the source of libedit.) To reproduce run the emacs command M-x load-library tramp and try to open a file like /ssh:user@host:/path This should work when the remote host is 12.1 and hang if the remote host is CURRENT. --=20 You are receiving this mail because: You are the assignee for the bug.=