From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Jakub T. Jankiewicz" Newsgroups: gmane.emacs.devel Subject: How to make custom REPL work in ansi-term? Date: Mon, 8 Jan 2024 16:16:02 +0100 Message-ID: <20240108161602.0ae166ce@jcubic> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21073"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 08 18:19:06 2024 Return-path: Envelope-to: ged-emacs-devel@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 1rMtHE-0005Fv-Rz for ged-emacs-devel@m.gmane-mx.org; Mon, 08 Jan 2024 18:19:04 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMtGU-0004Pf-UJ; Mon, 08 Jan 2024 12:18:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rMrTF-0008Bw-Fh for emacs-devel@gnu.org; Mon, 08 Jan 2024 10:23:22 -0500 Original-Received: from u1.atthost.pl ([2a0c:5840:0:15::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rMrTD-0006RD-77 for emacs-devel@gnu.org; Mon, 08 Jan 2024 10:23:21 -0500 Original-Received: from localhost (unknown [127.0.0.1]) by u1.atthost.pl (Postfix) with ESMTP id DF4B8125B53 for ; Mon, 8 Jan 2024 15:16:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at atthost.pl Original-Received: from u1.atthost.pl ([185.255.40.21]) by localhost (atthost.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5hASaPL-tbhd for ; Mon, 8 Jan 2024 16:16:03 +0100 (CET) Original-Received: from jcubic (unknown [178.218.193.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jcubic@jcubic.pl) by u1.atthost.pl (Postfix) with ESMTPSA id 80BE1122EF6 for ; Mon, 8 Jan 2024 16:16:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 u1.atthost.pl 80BE1122EF6 X-Mailer: Claws Mail 4.2.0 (GTK 3.24.39; x86_64-redhat-linux-gnu) Received-SPF: pass client-ip=2a0c:5840:0:15::1; envelope-from=SRS0=vuOC=IS=jcubic.pl=jcubic@attmail.pl; helo=u1.atthost.pl X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.248, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 08 Jan 2024 12:18:17 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:314755 Archived-At: Hi, I was asking similar question long ago, I'm not able to find replies on my mailbox but found a reference on question on Stack Overflow: https://stackoverflow.com/a/61300784/387194 The problem is that my REPL written in NodeJS doesn't work in Emacs ansi-term, you can use arrow keys for navigation and history. The same happen with native nodeJS command line. When moving cursor it add escape sequences to the input. NodeJS doesn't use readline library only it's own implementation written in JavaScript that's probbaly not 100% compatible with real readline. Is there something that NodeJS can do to fix the issue. Or maybe you can give me a pointers on what to search for in other to fix the issue. I may look into the source code and fix the issue. -- Jakub T. Jankiewicz, Senior Front-End Developer https://jcubic.pl/me https://koduj.org