Getting Tramp in Emacs to work with zsh as default shell

I was trapped by this issue for around one hour, until I finally discovered the solution from EmacsWiki:

If you use zsh and Tramp hangs every time you try to connect, try placing this in your .zshrc from the remote computer:

[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ '

Update
I found the configuration above failed to work today. The below is working for me now.

if [[ "$TERM" == "dumb" ]]
then
  unsetopt zle
  unsetopt prompt_cr
  unsetopt prompt_subst
  unfunction precmd
  unfunction preexec
  PS1='$ '
fi
Advertisements
Getting Tramp in Emacs to work with zsh as default shell

Avoid Emacs pinky

It is definitely unnatural to manipulate Emacs with “Ctrl” key. Some Emacs users suffer from Emacs pinky… One way to resolve this is swap Caps key and Ctrl key. Here is how I did it.

For Debian users (including myself)

Edit file /etc/default/keyboard, add


XKBOPTIONS="ctrl:nocaps"

Reboot your system, done. 🙂

Avoid Emacs pinky