Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Node.js with JS-comint in Emacs

I use Emacs 24.2. I've installed js-comint and js-mode from MELPA, executed run-js, and now in REPL instead of > sign i have this gibberish:

^[[1G> ^[[0K^[[3G

The REPL itself in Inferior Javascript mode works just fine, just the > sign is changed. If you enter unfinished expression, it even prints ^[[1G... ^[[0K^[[5G. The ^[ are system characters, that are not copied with copy-paste, i add them for you to have an idea.

In my init-file:

(require 'js-comint)
(setq inferior-js-program-command "nodejs")

In terminal calling nodejs produces working REPL.

Why prompt behaves this way? What should i do to correct this?

like image 890
Mirzhan Irkegulov Avatar asked Dec 13 '12 14:12

Mirzhan Irkegulov


People also ask

Is Emacs good for JavaScript?

Emacs comes with a major mode for JavaScript named js-mode . While it is a good major mode, we'll be using js2-mode instead, an external package that extends js-mode and provides a very interesting feature: instead of using regular expressions, it parses buffers and builds an AST for things like syntax highlighting.

Can I use JavaScript in node JS?

Node. js allows you to run JavaScript on the server.

Is Nextjs the same as NodeJs?

Node. js provides a very vast framework and includes many libraries to support every need a developer might come across. Next. js enhances the user experience by introducing server-side rendering with a lower threshold for developers.

CAN node js handle high traffic?

Node. js, to a greater extent than most application servers, is designed for scalability, and its web server side can handle a lot of Internet traffic reasonably well.


1 Answers

Just add one line in your .emacs:

(setenv "NODE_NO_READLINE" "1")

Answer come from this post: Node.js prompt '>' can not show in eshell

like image 106
tangxinfa Avatar answered Oct 01 '22 11:10

tangxinfa