all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Tramp over su, with odd zsh prompt
@ 2006-05-29  0:56 Stefan Monnier
  2006-05-29 20:06 ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2006-05-29  0:56 UTC (permalink / raw)



I recently tried to use Tramp to access a file via `su' and bumped into the
following problem: the prompt (resulting from a very plain default setting
PS1="%m%# ") looks like

    %<78 SPC>^M^Malfajor% 

where alfajor is the machine name (an argentine pastry).

So it seems that although Tramp sets TERM=dump, the `zsh' executable
(version 4.3.2, from Debian testing) uses funny carriaqe-return trickery and
for apparently no good reason.

Has anybody seen this before?  Should I just set
tramp-shell-prompt-pattern accordingly?  Have you heard of such
behavior already (and maybe some way to get zsh to behave a bit better)?


        Stefan

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

* Re: Tramp over su, with odd zsh prompt
  2006-05-29  0:56 Tramp over su, with odd zsh prompt Stefan Monnier
@ 2006-05-29 20:06 ` Michael Albinus
  2006-05-29 23:15   ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2006-05-29 20:06 UTC (permalink / raw)
  Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> I recently tried to use Tramp to access a file via `su' and bumped into the
> following problem: the prompt (resulting from a very plain default setting
> PS1="%m%# ") looks like
>
>     %<78 SPC>^M^Malfajor% 
>
> where alfajor is the machine name (an argentine pastry).
>
> So it seems that although Tramp sets TERM=dump, the `zsh' executable
> (version 4.3.2, from Debian testing) uses funny carriaqe-return trickery and
> for apparently no good reason.
>
> Has anybody seen this before?  Should I just set
> tramp-shell-prompt-pattern accordingly?  Have you heard of such
> behavior already (and maybe some way to get zsh to behave a bit better)?

When zsh is in interactive mode, it uses its internal zsh line editor
(zle). This provides left and right prompts; therefore the
spaces. Disabling zle for the Tramp case is sufficient.

The following lines in .zshrc work for me:

# Let Tramp come in
[ $TERM = "dumb" ] && unsetopt zle

>         Stefan

Best regards, Michael.

PS: "for apparently no good reason" depends. Play with promptinit /
prompt themes, you'll see lot of gimmicks.

PPS: I'll give it a short note in the Tramp manual.

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

* Re: Tramp over su, with odd zsh prompt
  2006-05-29 20:06 ` Michael Albinus
@ 2006-05-29 23:15   ` Stefan Monnier
  2006-05-30 16:16     ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2006-05-29 23:15 UTC (permalink / raw)
  Cc: emacs-devel

>> I recently tried to use Tramp to access a file via `su' and bumped into the
>> following problem: the prompt (resulting from a very plain default setting
>> PS1="%m%# ") looks like
>> 
>> %<78 SPC>^M^Malfajor% 
>> 
>> where alfajor is the machine name (an argentine pastry).
>> 
>> So it seems that although Tramp sets TERM=dump, the `zsh' executable
>> (version 4.3.2, from Debian testing) uses funny carriaqe-return trickery and
>> for apparently no good reason.
>> 
>> Has anybody seen this before?  Should I just set
>> tramp-shell-prompt-pattern accordingly?  Have you heard of such
>> behavior already (and maybe some way to get zsh to behave a bit better)?

> When zsh is in interactive mode, it uses its internal zsh line editor
> (zle).  This provides left and right prompts; therefore the spaces.
> Disabling zle for the Tramp case is sufficient.

> The following lines in .zshrc work for me:

> # Let Tramp come in
> [ $TERM = "dumb" ] && unsetopt zle

Yuck!

> PS: "for apparently no good reason" depends.  Play with promptinit /
> prompt themes, you'll see lot of gimmicks.

Still no good reasons since I don't use those extra features.  But I guess
it makes the code simpler.

> PPS: I'll give it a short note in the Tramp manual.

Could Tramp reasonably look for a prompt after ^M rather than only after ^J ?


        Stefan

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

* Re: Tramp over su, with odd zsh prompt
  2006-05-29 23:15   ` Stefan Monnier
@ 2006-05-30 16:16     ` Michael Albinus
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2006-05-30 16:16 UTC (permalink / raw)
  Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> PPS: I'll give it a short note in the Tramp manual.
>
> Could Tramp reasonably look for a prompt after ^M rather than only after ^J ?

Maybe. OTOH, Tramp makes some tests in order to determine the coding
system / eol conversion to be used. When it finds ^M in the output
stream, it might decide the wrong way. Remember, we are speaking about
su on a GNU/Debian Linux machine ...

Anyway, the implementation in Tramp for this decision is voodoo.
Comment in tramp.el (not from me): "this can't be the right way to do
it." I've planned already to revise this check; maybe there is a
better solution also for ^M.

>         Stefan

Best regards, Michael.

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

end of thread, other threads:[~2006-05-30 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-29  0:56 Tramp over su, with odd zsh prompt Stefan Monnier
2006-05-29 20:06 ` Michael Albinus
2006-05-29 23:15   ` Stefan Monnier
2006-05-30 16:16     ` Michael Albinus

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.