unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#27612: 25.2; invoking term from a remote eshell uses the local path
@ 2017-07-07 19:37 Pablo Barbachano
  2017-07-12 14:46 ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Pablo Barbachano @ 2017-07-07 19:37 UTC (permalink / raw)
  To: 27612



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))





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#27612: 25.2; invoking term from a remote eshell uses the local path
  2017-07-07 19:37 bug#27612: 25.2; invoking term from a remote eshell uses the local path Pablo Barbachano
@ 2017-07-12 14:46 ` Michael Albinus
  2017-07-14 22:00   ` Pablo Barbachano
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2017-07-12 14:46 UTC (permalink / raw)
  To: Pablo Barbachano; +Cc: 27612

Pablo Barbachano <pablo.barbachano@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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#27612: 25.2; invoking term from a remote eshell uses the local path
  2017-07-12 14:46 ` Michael Albinus
@ 2017-07-14 22:00   ` Pablo Barbachano
  2017-07-15  7:38     ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Pablo Barbachano @ 2017-07-14 22:00 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 27612


Hi Michael,

Michael Albinus <michael.albinus@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#27612: 25.2; invoking term from a remote eshell uses the local path
  2017-07-14 22:00   ` Pablo Barbachano
@ 2017-07-15  7:38     ` Michael Albinus
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2017-07-15  7:38 UTC (permalink / raw)
  To: Pablo Barbachano; +Cc: 27612

Pablo Barbachano <pablo.barbachano@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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-15  7:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-07 19:37 bug#27612: 25.2; invoking term from a remote eshell uses the local path Pablo Barbachano
2017-07-12 14:46 ` Michael Albinus
2017-07-14 22:00   ` Pablo Barbachano
2017-07-15  7:38     ` Michael Albinus

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).