Post title: Unwanted escape sequences in shell mode that are NOT due to colorizing-attempts
(see update below)
Any idea what can cause (unwanted) escape sequences to continue showing up in the Emacs shell
prompt (i.e., M-x shell
) despite:
(i) removing all color-related sequences from prompt definitions in the appropriate config files and
(ii) including the following in my init.el
file:
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
For example, this is what my shell prompt looks like (in Emacs)...
^[[J%
...but this is how I've defined the prompt in my .zshrc
file (I could be wrong but I suspect the issue is shell agnostic, i.e., I don't think it's specific to zsh
).
PROMPT='%% '
Similarly, this is what my GHCi interpreter prompt (i.e., Haskell REPL) looks like:
^[[?1h^[=λ:
...when this is the definition I've included in the ghci.conf
file:
:set prompt "λ: "
Running Emacs 24.4 on Lubuntu 14.04 with zsh as default shell. (All zsh features are working correctly in Emacs; this seems like a cosmetic issue.)
UPDATE: Solved
Shoddy attention to detail on my part; the following line in my .zshrc
profile was responsible:
export TERM=xterm-256color