My main setup uses zsh
and prezto
on Mac OS with a custom prompt theme (I use iTerm2
and not Terminal.app
).
I was wondering what's the best way to have a similar experience with an Emacs terminal emulator.
I seems that the answer is easy: M-x ansi-term
(or just M-x term
?)
However the prompt is not very nice as Emacs doesn't understand the special character my theme uses (some kind of fat arrow).
How could I fix this? Can I 'detect' in my zshrc
file that I'm inside Emacs and change the prompt?
(set-terminal-coding-system 'utf-8-unix)
in your init file?INSIDE_EMACS
environment variable. The value varies contextually (it is different in aM-x shell
buffer than it is in aM-x term
buffer), so you can also make more granular decisions if need be.