Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Something wrong with Emacs shell

Tags:

emacs

I use Ubuntu8.10 and emacs-snapshot. Running shell-mode on emacs and input "ls" shows escape codes:

screenshot http://lh3.ggpht.com/_os_zrveP8Ns/SdMmohKNjmI/AAAAAAAADB4/VlKpr5H_7ZA/s512/screen.png

How can I get the output I expect?

like image 305
linjunhalida Avatar asked Apr 01 '09 08:04

linjunhalida


People also ask

What is Emacs shell?

Eshell is a shell-like command interpreter implemented in Emacs Lisp. It invokes no external processes except for those requested by the user.

Is Emacs its own shell?

Emacs comes with its own shell (as in, like bash or zsh ) written in entirely in Emacs-Lisp.

How do I stop Emacs shell?

Kill Emacs ( save-buffers-kill-terminal ). On a text terminal, suspend Emacs; on a graphical display, iconify (or “minimize”) the selected frame ( suspend-frame ). Killing Emacs means terminating the Emacs program. To do this, type C-x C-c ( save-buffers-kill-terminal ).


2 Answers

You can use AnsiTerm which does support colors or you can enable AnsiColor for the normal shell:

(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t) (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on) 
like image 130
danielpoe Avatar answered Sep 22 '22 12:09

danielpoe


Furthermore, you may choose another shell: M-x term or M-x eshell. The former provides an interface that is much closer to a real terminal emulator than shell-mode (once you start it, you can get out of the mode with C-c C-j and get in again with C-c C-k). The latter is a shell implementation written in Elisp (you can use the common shell commands as well as evaluating Lisp code).

like image 23
viam0Zah Avatar answered Sep 23 '22 12:09

viam0Zah