all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Comint mode with REPL in Node.js and Readline
@ 2020-04-02 11:18 Jakub Jankiewicz
  2020-04-02 11:41 ` Jakub Jankiewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jankiewicz @ 2020-04-02 11:18 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I have issue with comint mode:

I reproduced the issue with simple Node.js code:

shell.js file:

#!/usr/bin/env node
const readline = require('readline');

var prompt = 'lips> ';
var continuePrompt = '... ';
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: prompt,
    terminal: !!process.stdin.isTTY
});
if (process.stdin.isTTY) {
    rl.prompt();
}

rl.on('line', function(line) {
    if (process.stdin.isTTY) {
        rl.prompt();
    }
});

If I run this as scheme in GNU Emacs:

(run-scheme "/path/.../shell.js")
;; this is needed otherwise I get duplicated input
(setq comint-process-echoes t)

And the issue I have is that when I resize the window I've got duplicated:

lips> lips> lips> lips>

What I did wrong with my REPL in Node.js anybody have idea if I need to setup
something in Emacs. REPL works fine in terminal emulator and ansi-term.

I've asked the same question on StackOverflow in hope I'll get some answers
how to fix this:

https://stackoverflow.com/q/60987722/387194

I have no idea if it's issue with Node.js Readline or with GNU Emacs comint
mode.

--
Jakub Jankiewicz, Web Developer
https://jcubic.pl/me



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-02 11:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-02 11:18 Comint mode with REPL in Node.js and Readline Jakub Jankiewicz
2020-04-02 11:41 ` Jakub Jankiewicz

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.