help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Comint mode with REPL in Node.js and Readline


From: Jakub Jankiewicz
Subject: Comint mode with REPL in Node.js and Readline
Date: Thu, 2 Apr 2020 13:18:06 +0200

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]