From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128633 invoked by alias); 25 Feb 2016 23:51:48 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 128623 invoked by uid 89); 25 Feb 2016 23:51:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=andrea X-HELO: aibo.runbox.com Received: from aibo.runbox.com (HELO aibo.runbox.com) (91.220.196.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 25 Feb 2016 23:51:46 +0000 Received: from [10.9.9.212] (helo=mailfront12.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1aZ5h8-0001mg-PW; Fri, 26 Feb 2016 00:51:42 +0100 Received: from 70-36-239-75.dsl.dynamic.fusionbroadband.com ([70.36.239.75] helo=toshie.bothner.com) by mailfront12.runbox.com with esmtpsa (uid:757155 ) (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1aZ5h3-0006qm-8Q; Fri, 26 Feb 2016 00:51:37 +0100 Subject: Re: tab-completion implemented for Kawa To: Andrea Bernardini , kawa@sourceware.org References: <56CE6324.80502@bothner.com> From: Per Bothner Message-ID: <56CF9386.6040001@bothner.com> Date: Thu, 25 Feb 2016 23:51:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-q1/txt/msg00029.txt.bz2 On 02/25/2016 03:33 PM, Andrea Bernardini wrote: > Hi Per, > This is a very nice feature! Thanks! > > BTW, something I miss in the Kawa REPL is some kind of history. I'm > used to the bash shell, where you can use the up arrow key to get the > previous executed commands. Currently pressing the arrow key in Kawa > inserts a weird sequence of characters. That what the arrow keys are supposed to send. However, Java doesn't have a portable pure-Java mechanism to interpret those key sequences. > I know that other languages' > REPLs have the same problem (like Racket), however there are some that > support this feature (Python, Haskell). Do you think that could be > doable for Kawa? That's what the --enable-kawa-frontend configure option does. It compiles a C program as a front-end to Kawa. This front-end program uses GNU readline. There may be some portability issues with the frontend - I haven't made any effort to port it, and it would certainly need major changes on Windows. More portable is the JLine2 support I recently announced. That is a 99%-pure-Java re-implementation of GNU readline. That gives you input editing, history, and (now) tab-completion. JLine2 may requires some native code on Windows; I haven't tried it under Windows yet. It should work out-of-the-box on most Unix-like OSes, including GNU/Linux and MacOS. (It should work on Windows too - I just don't have the instructions for doing that.) -- --Per Bothner per@bothner.com http://per.bothner.com/