This is odd. I have defined the following prompt in zsh
:
local user_host='%{$terminfo[bold]$fg[green]%}%n @ %m%{$reset_color%}'
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
local git_branch='$(git_prompt_info)%{$reset_color%}'
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
PROMPT="╭─${user_host} %D{[%a, %b %d %I:%M:%S]} ${current_dir} ${git_branch}
╰─%B$%b "
RPS1="${return_code}"
It works great on gnome-terminal
as well as in an ansi-term
terminal in Emacs (M-x ansi-term
) - see the example below:
However, it does not work well under multi-term
in Emacs as you can see below:
I thought multi-term
would be capable of interpreting the same set of escape characters that a terminal like gnome-terminal
or ansi-term
does. Why is it not interpreting the escape characters returned by git-prompt_info
and others correctly?
I have also tried:
- M-x
set-terminal-coding-system
and setting it toutf-8-unix
TERM=eterm-color
within the multi-term terminal, or before calling Emacs, etc.TERM=
within the multi-term terminal, or before calling Emacs, etc.- Removing any
export TERM
from my.zshrc
Update (January 29, 2014):
The best solution so far seems to be to do the following:
TERM=xterm-256color
but causes another problem that I have reported here: Passing escape sequences to shells within ansi-term in Emacs.