GNU bug report logs - #27612
25.2; invoking term from a remote eshell uses the local path

Previous Next

Package: emacs;

Reported by: Pablo Barbachano <pablo.barbachano <at> gmail.com>

Date: Fri, 7 Jul 2017 19:47:02 UTC

Severity: wishlist

Merged with 36748, 44310

Found in versions 25.2, 26.2, 27.1

To reply to this bug, email your comments to 27612 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#27612; Package emacs. (Fri, 07 Jul 2017 19:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pablo Barbachano <pablo.barbachano <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 07 Jul 2017 19:47:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pablo Barbachano <pablo.barbachano <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.2; invoking term from a remote eshell uses the local path
Date: Fri, 07 Jul 2017 21:37:53 +0200

M-x eshell
$ cd /ssh:remote-host:
$ hostname
<remote-hostname>

$ term hostname
<local-hostname>

term does not seem to get the default-directory from eshell.

There's a similar unanswered question in emacs stackexchange: https://emacs.stackexchange.com/questions/17862/eshell-visual-commands-with-tramp



In GNU Emacs 25.2.1 (x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2017-07-01, modified by Debian built on trouble
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description:	Debian GNU/Linux testing (buster)

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs25:/etc/emacs:/usr/local/share/emacs/25.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.2/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --with-x=yes --with-x-toolkit=lucid
 --with-toolkit-scroll-bars --without-gconf --without-gsettings
 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs25-xZBDtE/emacs25-25.2+1=. -fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS NOTIFY ACL
LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS LUCID X11

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: EShell

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
<f12> is undefined
History item: 128
History item: 1
delete-backward-char: Text is read-only
Mark set
user-error: Beginning of history; no preceding item
user-error: End of history; no default available
user-error: Beginning of history; no preceding item
user-error: End of history; no default available [2 times]
delete-backward-char: Text is read-only

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired rfc822 mml mml-sec epg
epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils pp
tramp-cache tramp-sh tramp tramp-compat auth-source cl-seq eieio
byte-opt bytecomp byte-compile cl-extra cconv eieio-core cl-macs gv
gnus-util mm-util help-fns help-mode mail-prsvr password-cache
tramp-loaddefs trampver ucs-normalize shell format-spec advice em-unix
em-term term disp-table easymenu ehelp em-script em-prompt em-ls
cl-loaddefs pcase cl-lib em-hist em-pred em-glob em-dirs em-cmpl
em-basic em-banner em-alias pcomplete comint ansi-color ring esh-var
esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell
esh-module esh-mode esh-util time-date mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
dbusbind inotify dynamic-setting font-render-setting x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 230240 13684)
 (symbols 48 24109 0)
 (miscs 40 62 163)
 (strings 32 28951 6730)
 (string-bytes 1 919448)
 (vectors 16 39668)
 (vector-slots 8 748746 7266)
 (floats 8 283 163)
 (intervals 56 407 0)
 (buffers 976 20))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27612; Package emacs. (Wed, 12 Jul 2017 14:47:02 GMT) Full text and rfc822 format available.

Message #8 received at 27612 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Pablo Barbachano <pablo.barbachano <at> gmail.com>
Cc: 27612 <at> debbugs.gnu.org
Subject: Re: bug#27612: 25.2;
 invoking term from a remote eshell uses the local path
Date: Wed, 12 Jul 2017 16:46:43 +0200
Pablo Barbachano <pablo.barbachano <at> gmail.com> writes:

Hi Pablo,

> M-x eshell
> $ cd /ssh:remote-host:
> $ hostname
> <remote-hostname>
>
> $ term hostname
> <local-hostname>
>
> term does not seem to get the default-directory from eshell.

That is because term.el is not Tramp-aware. In `term-exec-1', it uses
`start-process' instead of `start-file-process'.

One could replace this, but scanning term.el, there seems to be a tight
integration with ange-ftp. So I guess it needs further work to cooperate
with Tramp.

I'm not a term.el user, so I don't know, whether it is a feature to run
always locally. Other people might tell, whether it would be appropriate
to support remoteness.

If yes, I could try to migrate term.el. But this would take time anyway,
understanding 4500 lines of unknown code. And maybe it is not possible
at all to support a full equipped remote terminal in Emacs.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27612; Package emacs. (Fri, 14 Jul 2017 22:01:01 GMT) Full text and rfc822 format available.

Message #11 received at 27612 <at> debbugs.gnu.org (full text, mbox):

From: Pablo Barbachano <pablo.barbachano <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 27612 <at> debbugs.gnu.org
Subject: Re: bug#27612: 25.2;
 invoking term from a remote eshell uses the local path
Date: Sat, 15 Jul 2017 00:00:47 +0200
Hi Michael,

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

> That is because term.el is not Tramp-aware. In `term-exec-1', it uses
> `start-process' instead of `start-file-process'.

I tried that and my dummy test case suddenly worked. So that's enough to make it work, but more complex programs like 'top' or 'ipython' seem to have the output mangled. For example if I now do `term bash`

```
$ echo -e "1"
             1
              $ echo -e "\r1"
1
```

So something is going on with how the newlines are interpreted in the terminal. This does not happen if I run them locally.

I can try playing with this for some time and maybe send a patch.

Thanks for the pointer!
--
Pablo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#27612; Package emacs. (Sat, 15 Jul 2017 07:39:02 GMT) Full text and rfc822 format available.

Message #14 received at 27612 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Pablo Barbachano <pablo.barbachano <at> gmail.com>
Cc: 27612 <at> debbugs.gnu.org
Subject: Re: bug#27612: 25.2;
 invoking term from a remote eshell uses the local path
Date: Sat, 15 Jul 2017 09:38:46 +0200
Pablo Barbachano <pablo.barbachano <at> gmail.com> writes:

> Hi Michael,

Hi Pablo,

>> That is because term.el is not Tramp-aware. In `term-exec-1', it uses
>> `start-process' instead of `start-file-process'.
>
> I tried that and my dummy test case suddenly worked.

Sure. "hostnme" just dumps a string, and it doesn't send escape
sequences to the terminal.

> So that's enough to make it work, but more complex programs like 'top' or 'ipython' seem to have the output mangled. For example if I now do `term bash`
>
> ```
> $ echo -e "1"
>              1
>               $ echo -e "\r1"
> 1
> ```
>
> So something is going on with how the newlines are interpreted in the terminal. This does not happen if I run them locally.
>
> I can try playing with this for some time and maybe send a patch.

You might try it. But I believe it is more than just newline
handling. Escape sequences are sent, and the buffer playing the tty is
not prepared for this in the remote case. I would start with the
process-filter.

> Thanks for the pointer!
> --
> Pablo

Best regards, Michael.




Severity set to 'wishlist' from 'minor' Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Sun, 08 Sep 2019 10:12:02 GMT) Full text and rfc822 format available.

Merged 27612 36748. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Sun, 08 Sep 2019 10:13:02 GMT) Full text and rfc822 format available.

Merged 27612 36748 44310. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Sat, 14 Nov 2020 09:49:02 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 156 days ago.

Previous Next


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