Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the arrow keys in the REPL should cycle through recently used commands #54

Closed
edwinb opened this issue May 20, 2020 · 9 comments
Closed

Comments

@edwinb
Copy link
Collaborator

edwinb commented May 20, 2020

Issue by malte-v
Saturday Apr 18, 2020 at 07:29 GMT
Originally opened as edwinb/Idris2-boot#297


Currently using the arrow keys just prints ANSI sequences, which is different from the Idris 1 REPL.

Steps to Reproduce

Enter the Idris 2 REPL and use the arrow keys.

Expected Behavior

It cycles through the recently used commands.

Observed Behavior

Escape sequences get printed.

@edwinb
Copy link
Collaborator Author

edwinb commented May 20, 2020

Comment by gallais
Saturday Apr 18, 2020 at 08:54 GMT


Note that you can use rlwrap to cope with the current limitations

@edwinb
Copy link
Collaborator Author

edwinb commented May 20, 2020

Comment by edwinb
Tuesday Apr 21, 2020 at 10:29 GMT


Yes, I run through rlwrap (in fact I've aliased idris2). This is a fairly big feature request, in practice, requiring readline support or similar, and then leads to wanting tab completion of function names. I actually wonder if a better way is to write a separate fancy REPL via the IDE protocol, and to keep what Idris 2 itself does as simple as possible.

melted pushed a commit to melted/Idris2 that referenced this issue Jun 1, 2020
Make it a little easier to debug IDE mode
@madushan1000
Copy link

Since idris2 is run as a script to chezscheme, is there no way to use chezscheme repl for autocomplete and stuff?

@SmiVan
Copy link
Contributor

SmiVan commented Dec 22, 2020

Both Idris 1's REPL and Haskell's GHCi rely on haskeline for command-line interface, which in turn relies on haskell's POSIX and Win32 bindings.

In the past, GHCi used to rely on editline, which is a set of bindings to libedit.


Alternatively, ChezScheme's REPL "cafe" appears to be using scheme's native read and working just fine, with history and arrows working, so perhaps that could be somehow reused for the idris2 REPL? This would certainly lighten the load from the idris side - leaving it up to the underlying language to deal with the interactive command line.

@gallais gallais added good first issue Good for newcomers cli: repl labels Feb 22, 2021
@michaelmesser
Copy link
Contributor

Is this still wanted given Edwin's comments on #807 (comment)?

Sorry to be a pain, though, but I'd much prefer to do anything at all fancy in the REPL (including readline support) in a separate system, interacting with Idris via the IDE protocol, and keep what we have here using the existing minimal interface. This is partly about keeping dependencies down, and partly about keeping the maintenance burden down.

@ska80
Copy link
Contributor

ska80 commented Mar 18, 2021

Can this issue be closed?

@gallais
Copy link
Member

gallais commented Apr 27, 2021

Yes. Official recommendation is to either:

  • use rlwrap
  • implement a standalone fancy REPL (:D)

@gallais gallais closed this as completed Apr 27, 2021
brendanzab added a commit to brendanzab/fathom that referenced this issue Aug 25, 2022
@Qumeric
Copy link

Qumeric commented Jun 17, 2023

@gallais I don't mind rlwrap solution but I am not sure if everyone is aware of it. Perhaps it shall be added to FAQ or readme?

@gallais
Copy link
Member

gallais commented Jun 17, 2023

It already is there in two places:

https://idris2.readthedocs.io/en/latest/tutorial/interactive.html#editing-at-the-repl
https://idris2.readthedocs.io/en/latest/faq/faq.html#how-do-i-get-command-history-in-the-idris2-repl

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants