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

repl ignores inputrc #720

Open
nathanielvirgo opened this issue Dec 26, 2020 · 5 comments
Open

repl ignores inputrc #720

nathanielvirgo opened this issue Dec 26, 2020 · 5 comments

Comments

@nathanielvirgo
Copy link

nathanielvirgo commented Dec 26, 2020

I have the following lines in my ~/.inputrc:

"\e[A": history-search-backward
"\e[B": history-search-forward

For most apps that use the readline library, this means that I can search my history by typing the first few characters of a previous command and pressing the up arrow. However, spago repl seems to ignore this, and just goes to the previous history entry, regardless of what I type.

This feature would be particularly useful for purescript, since there seems to be no way to reload a package without also losing all the bindings that that were entered previously. It would be a lot easier to re-enter commands if I was able to search the history for them.

(By the way, I don't yet understand the purescript ecosystem well enough to know if this is an issue with spago or some other package - if I should file this issue somewhere else please let me know.)

@f-f
Copy link
Member

f-f commented Dec 26, 2020

@nathanielvirgo spago repl is just a thin wrapper over purs repl - are you able to replicate with just purs repl?

@nathanielvirgo
Copy link
Author

nathanielvirgo commented Dec 27, 2020

I was a bit confused about that. purs repl just says:

% purs repl  
purs repl: No input files; try running `pulp psci` instead.
For help getting started, visit https://github.com/purescript/documentation/blob/master/guides/PSCi.md
Usage: For basic information, try the `--help' option.

but purs --help does't say anything about how to use repl, and the provided link just tells me to run spago. I don't know what pulp is, but it's not installed on my system.

@f-f
Copy link
Member

f-f commented Dec 27, 2020

Right, sorry for that. This should work properly: purs repl $(spago sources)

@f-f
Copy link
Member

f-f commented Feb 3, 2021

@nathanielvirgo have you succeeded at testing if this behaviour is due to spago or purs?

I dug into this, and it looks like since purs is using the haskeline library to read input, your .inputrc would not work, but you should be able to configure the repl with a ~/.haskeline file, more details here

@m15a
Copy link

m15a commented Jan 7, 2024

Encountered a similar problem and I found that

  • in the repl launched by purs repl $(spago sources), completion just works, and
  • by spago repl, it does not work.

In both cases I installed psci-support.

  • purs version: 0.15.14
  • spago version: 0.93.22

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

3 participants