unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / 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

* Re: Comint mode with REPL in Node.js and Readline
  2020-04-02 11:18 Comint mode with REPL in Node.js and Readline Jakub Jankiewicz
@ 2020-04-02 11:41 ` Jakub Jankiewicz
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jankiewicz @ 2020-04-02 11:41 UTC (permalink / raw)
  To: help-gnu-emacs

Forget to mention I use:

GNU Emacs 26.3; Fedora 30

The same happen in emacs -q

On Thu, 2 Apr 2020 13:18:06 +0200
Jakub Jankiewicz <jcubic@onet.pl> wrote:

> 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

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).