From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Jakub Jankiewicz Newsgroups: gmane.emacs.help Subject: Re: Comint mode with REPL in Node.js and Readline Date: Thu, 2 Apr 2020 13:41:25 +0200 Message-ID: <20200402134125.7795321f@jcubic> References: <20200402131806.40916cb2@jcubic> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="38496"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 02 13:43:12 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJyFb-0009vM-Ko for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 02 Apr 2020 13:43:11 +0200 Original-Received: from localhost ([::1]:37244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJyFa-0000DO-My for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 02 Apr 2020 07:43:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52020) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJyEB-0008Hh-7Z for help-gnu-emacs@gnu.org; Thu, 02 Apr 2020 07:41:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJyEA-0000Du-3B for help-gnu-emacs@gnu.org; Thu, 02 Apr 2020 07:41:43 -0400 Original-Received: from smtpo114.poczta.onet.pl ([213.180.149.167]:55356) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jJyE9-0008UL-CO for help-gnu-emacs@gnu.org; Thu, 02 Apr 2020 07:41:41 -0400 Original-Received: from jcubic (unknown [185.129.113.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jcubic@onet.pl) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 48tLkH2h54z4fJj3f for ; Thu, 2 Apr 2020 13:41:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onet.pl; s=2011; t=1585827687; bh=K8sT3CjMEa/i9Vt52fM54d0eFmCQSnMajdvUGk1ma9g=; h=Date:From:To:Subject:In-Reply-To:References:From; b=BcA1i08D3xUWDtedu4glvXJ4gGgmo+K1QJ+5LKWYxi4ie5YxF2a55EA0/W5E43fpN noIG7nQHr11r4/QxZfLVBOP7vSnt+3ILe28db301gs22NhAz/WoXHxguoGNnqD2tfF aKulDt8/UnfDZElguJ49d1Fq8181U/7jexMON7RE= In-Reply-To: <20200402131806.40916cb2@jcubic> X-Mailer: Claws Mail 3.17.3git196 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-ONET_PL-MDA-SEGREGATION: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 213.180.149.167 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122736 Archived-At: 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 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