spago icon indicating copy to clipboard operation
spago copied to clipboard

repl ignores inputrc

Open nathanielvirgo opened this issue 4 years ago • 5 comments

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.)

nathanielvirgo avatar Dec 26 '20 12:12 nathanielvirgo

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

f-f avatar Dec 26 '20 15:12 f-f

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.

nathanielvirgo avatar Dec 27 '20 03:12 nathanielvirgo

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

f-f avatar Dec 27 '20 17:12 f-f

@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

f-f avatar Feb 03 '21 22:02 f-f

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

m15a avatar Jan 07 '24 02:01 m15a