Node.js prompt '>' can not show in eshell
Asked Answered
M

2

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?

Maryettamaryjane answered 22/2, 2012 at 7:35 Comment(2)
Those look like terminal control codes. Maybe try running in an `ansi-term' instead?Brachycephalic
Use bash/zsh in emacs and run node is ok. But I want to try node repl in eshell.Maryettamaryjane
S
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'
Sudor answered 22/2, 2012 at 13:48 Comment(2)
This doesn't work for me using Node v0.10.8 in Emacs 24.3.50.1 (2013-05-29) where my eshell is sending commands to a remote machine over TRAMP.Intellect
Anyone found a solution?Drench
K
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.

Kirchner answered 17/3, 2013 at 14:23 Comment(0)
S
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'
Sudor answered 22/2, 2012 at 13:48 Comment(2)
This doesn't work for me using Node v0.10.8 in Emacs 24.3.50.1 (2013-05-29) where my eshell is sending commands to a remote machine over TRAMP.Intellect
Anyone found a solution?Drench

© 2022 - 2024 — McMap. All rights reserved.