Summary: | CURRENT libedit breaks emacs tramp-mode | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | John F. Carr <jfc> | ||||||
Component: | misc | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||||
Status: | Closed FIXED | ||||||||
Severity: | Affects Only Me | CC: | ashish, bapt, emacs, jhb, naito.yuichiro, trueos | ||||||
Priority: | --- | ||||||||
Version: | CURRENT | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
John F. Carr
2020-02-02 16:42:07 UTC
It seems odd that emacs tries to do this to a terminal emulator instead of opening an auxiliary ssh data channel over the same master connection. I know we can’t change tramp mode overnight but this seems like a misuse of ssh. I reported this as an emacs bug too and a workaround will be in a future version of the Emacs tramp package: install a temporary .editrc to suppress line editing. Hi, this PR insterests to me. In my additional investigation, NetBSD doesn't have this problem, because -E option of /bin/sh is not enabled by default. So NetBSD's /bin/sh doesn't enter edit mode. The -E option is enabled by default on FreeBSD. I think emacs should execute "set +E" just before "stty -inlcr -onlcr -echo kill '^U' erase '^H'". I believe this will solve this problem. I'm afraid that changing ~/.editrc affects to another /bin/sh processes which are created while tramp-mode is running. Some users are really running /bin/sh as a login shell. If they run tramp-mode and login to the same server, they will be confused. FYI that this is now broken on 12 stable as well. Created attachment 216619 [details]
emacs-port.patch
(In reply to John Baldwin from comment #4) Could you try `emacs-port.patch` on your Ports tree? It will fix this problem. I'm not sure where this problem is filed in the emacs bug tracking system. (In reply to Yuichiro NAITO from comment #6) Hi Yuichiro, It looks like the Emacs bug on debbug as 39399 and is listed here: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=39399 Perhaps you want to upstream the patch there as well? (In reply to Trenton Schulz from comment #7) Thanks for the link. I sent my patch and explained my investigation. Created attachment 216873 [details]
emacs-port.patch
Now tramp mode has been fixed in the tramp repository. http://git.savannah.gnu.org/cgit/tramp.git/commit/?id=4c04a886b62263efa5d776538e5f6f6e4ff09fc2 My patch was rejected because it was not Posix standard. But tramp-sh.el already has a same code `set +o emacs +o vi`, it has been moved up to initialize code block before tramp hangs execution. This code will be included future release. If somebody wants to fix current emacs-26.3, try `emacs-port.patch` that I updated to new one. Oops, I missed obsoleting previous one! emacs@ Could you please apply 'emacs-port.patch' to Ports tree? I talked about this PR in FreeBSD workshop Tokyo on July 31. The organizer hrs@ said that he wants to use this patch on FreeBSD Ports. Thanks, looking at this. A commit references this bug: Author: ashish Date: Mon Aug 3 18:21:18 UTC 2020 New revision: 544097 URL: https://svnweb.freebsd.org/changeset/ports/544097 Log: - Add a patch to make Emacs' TRAMP mode work with 12-STABLE, and 13-CURRENT remote hosts PR: 243807 Submitted by: Yuichiro NAITO <nairo dot yuichiro at gmail dot com> Reported by: John F. Carr <jfc at mit dot edu> Changes: head/editors/emacs/Makefile head/editors/emacs/files/patch-lisp_net_tramp-sh.el The diff seems to have worked as expected. Committed, thanks! |