tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp (2.3.5.26.3); Hangs when trying to remote edit files on my ras


From: Michael Albinus
Subject: Re: tramp (2.3.5.26.3); Hangs when trying to remote edit files on my raspberrypi overs sh
Date: Wed, 18 Sep 2019 14:35:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Michael Albinus <address@hidden> writes:

Hi Nicolas,

>> I added  [[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' to my zsh
>> as per EmacsWiki which seems to have done the trick.
>>
>> Would it be possible to have these options guaranteed on Tramp's side
>> of things instead?
>
> That's not so simple. Tramp does not know which shell your are
> using. Per default, it applies "/bin/sh", which can be a link to
> whatever. Therefore, Tramp cannot pass any random option to the shell.
>
> If Tramp would know which shell is invoked, it could do better. There is
> the variable tramp-sh-extra-args, which knows something about bash. One
> could add also extra args for zsh. I don't use zsh myself, but if I
> understand the docs, "+Z" disables zle. Could you please confirm?
>
> You could achieve this by applying
>
>      (add-to-list 'tramp-sh-extra-args '("/zsh\\'" . "+Z"))
>
> Second point is telling Tramp to call zsh. This is done by setting the
> connection variable remote-shell, like
>
>      (add-to-list 'tramp-connection-properties
>                   (list (regexp-quote "/ssh:your-raspberry:")
>                         "remote-shell" "/usr/bin/zsh"))
>
> Adapt the host name and the path name for zsh. If everything works OK
> for you, and you don't need to unset tle in your zsh init file anymore,
> I will apply the change to tramp-sh-extra-args in the Tramp sources.

I've applied the changes in Tramp, will appear with next Tramp 2.4.2.3
in GNU ELPA (around end of September). In the Tramp manual, ther is the
new subsection

--8<---------------cut here---------------start------------->8---
4.16.1 Changing the default remote shell

Per default, TRAMP uses the command ‘/bin/sh’ for strting a shell on
the remote host.  This can be changed by setting the connection
property ‘remote-shell’, see *Note Predefined connection
information::.  Other properties might be adapted as well, like
‘remote-shell-login’ or ‘remote-shell-args’.  If you want, for
example, use ‘/usr/bin/zsh’ on a remote host, you might apply

     (add-to-list 'tramp-connection-properties
                  (list (regexp-quote "/ssh:user@host:")
                        "remote-shell" "/usr/bin/zsh"))

   This approach has also the advantage, that settings in
‘tramp-sh-extra-args’ will be applied.  For zsh, the trouble with the
shell prompt due to set zle options will be avoided.
--8<---------------cut here---------------end--------------->8---

>> Regards,
>>
>> Nicholas Greensmith

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]