0

I'm running GNU Emacs (23.1.1) on Windows and when I run a cygwin shell inside emacs I get garbage like the following, after each command:

^[]0;/cygdrive/c/emacs-23.1/bin
^[[32user@HOST [33m/cygdrive/c/emacs-23.1/bin[0m

Note: I've replaced my real user and host name with user/HOST.

I've found a few links that describe how to set up emacs with cygwin on Windows including this one on SO: How can I run Cygwin Bash Shell from within Emacs?

That hasn't helped. As of right now, I don't have anything referencing shells in my .emacs file except for this:

;; For the interactive shell
(setq explicit-shell-file-name "bash")

So I'm not even sure how emacs is finding my cygwin shell. Any help is appreciated. Thanks.

Community
  • 1
  • 1
mrmbd
  • 41
  • 1
  • 3
  • Your TERM environment variable is set incorrectly; those are escape sequences for generating color output which aren't supported in the emacs shell. – Wooble Sep 01 '11 at 16:43
  • Any idea how to do change it via my .emacs file? – mrmbd Sep 01 '11 at 19:25

1 Answers1

3

Try adding these lines to your .emacs file

(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

I'm not sure if these are the correct ones but let me know (as my .emacs file has gotten quite large over the years)

Jesus Ramos
  • 22,940
  • 10
  • 58
  • 88