unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jakub Jankiewicz <jcubic@onet.pl>
To: help-gnu-emacs@gnu.org
Subject: Comint mode with REPL in Node.js and Readline
Date: Thu, 2 Apr 2020 13:18:06 +0200	[thread overview]
Message-ID: <20200402131806.40916cb2@jcubic> (raw)

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	other threads:[~2020-04-02 11:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02 11:18 Jakub Jankiewicz [this message]
2020-04-02 11:41 ` Comint mode with REPL in Node.js and Readline Jakub Jankiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200402131806.40916cb2@jcubic \
    --to=jcubic@onet.pl \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).