Readline interface: Difference between revisions

Content added Content deleted
Line 553: Line 553:


If you are not inclined to install Readline ''or'' Linenoise, the REPL also works fairly well with 3rd party tools like rlwrap.
If you are not inclined to install Readline ''or'' Linenoise, the REPL also works fairly well with 3rd party tools like rlwrap.

=={{header|Phix}}==
The phix interpreter has a readline interface, however the code involved is far too much to replicate here
(see p.exw, processCommandLine() which opens p.ini and populates default_commandlines, then invokes gets0()
from pgets0.ew with keyHandler() as a callback. Currently only tested/working on Windows, not linux.)
There are no "application specific commands", however you could init default_commandlines with some.

While the lack of code may disappoint, I think this is a closer match to the task intention than most.

A snapshot of running the interpreter: first I pressed ?, then F7, then "ed": keying "e" did little,
but "ed" auto-completed the "ix" part as that was then the only match.
<pre>
Phix hybrid interpreter/compiler.

Version 0.7.9 (32 bit Windows) Copyright Pete Lomax 2006..2016

Enter ? for options or filename to execute:?

<snip>

Press F7 to list prompt history, up/down to select.

Enter ? for options or filename to execute:
demo\pGUI\tee
demo\edix\edix
demo\win32demo\generic.exw
t61
p7
demo\win32demo\generic
-d! t01
-d! test/t01type.exw
edix
test\trace
p64
-c p64
-cp
-test
-c -test
-c e01
pgui
-d e01
pdemo
e01
use (pg) up/down to select:edix
</pre>


=={{header|Pike}}==
=={{header|Pike}}==