Tyrael Tong
Tyrael Tong

Reputation: 761

zsh in Emacs output junk characters

No matter I use term or ansi-term to start zsh in Emacs, I encounter this problem, whenever I input commands, the output will have some junk characters like:

[ruby-1.9.2] ~ pwd
2;pwd1;pwd/Users/tyraeltong

the 2;pwd1;pwd is screwing the output, don't know whether others are experiencing same problem? I found a similar thread here Getting Emacs ansi-term and Zsh to play nicely but by [[ $TERM == eterm-color ]] && export TERM=xterm I still see the junk characters.

Upvotes: 6

Views: 3901

Answers (3)

BitPusher
BitPusher

Reputation: 1030

Found the solution in the related post mentioned earlier

In a nutshell, in emacs M-x package-install and install multi-term. M-x multi-term kicks off a shell, with all the bells & whistles oh-my-zsh has to offer

Upvotes: 3

Tassilo Horn
Tassilo Horn

Reputation: 821

Emacs doesn't play nice with ZLE, so I have this in my ~/.zshrc:

if [[ -n ${INSIDE_EMACS} ]]; then
    # This shell runs inside an Emacs *shell*/*term* buffer.
    prompt walters
    unsetopt zle
fi

Upvotes: 6

Burton Samograd
Burton Samograd

Reputation: 3638

It could be an erronious PROMPT_COMMAND that has bash syntax. Try:

export PROMPT_COMMAND=""

and see if that helps.

Upvotes: 0

Related Questions