6

I want to run Node.js in eshell, but the prompt does not right:

enter image description here

So, how can I fix this?

Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
unionx
  • 437
  • 3
  • 15
  • 1
    Those look like terminal control codes. Maybe try running in an `ansi-term' instead? –  Feb 22 '12 at 10:44
  • Use bash/zsh in emacs and run node is ok. But I want to try node repl in eshell. – unionx Feb 22 '12 at 10:45

2 Answers2

8

An alternative is to add this to your .emacs:

(setenv "NODE_NO_READLINE" "1")

The benefit of this approach is that it will also work for other invocations of Node programs that you run directly.

Joubert Nel
  • 3,154
  • 3
  • 26
  • 24
7

Try running node in eshell with NODE_NO_READLINE enabled. For example, you could add an alias to eshell by running this command in eshell:

alias node 'NODE_NO_READLINE=1 node'
Luke Girvin
  • 13,221
  • 9
  • 64
  • 84