I use rlwrap with a simple "one-liner" repl (inspired by previous
suggestions by Steven G Johnson):

# $HOME/bin/rlrepl.jl  (julia 0.3.0)
function rlrepl()
    ok=true
    push!(LOAD_PATH,pwd())
    while ok
        print("jul> ")
        linerd =readline()
        if length(linerd) == 0
            return
        end
        line = strip(linerd)
        if length(line) == 0
            continue
        end
        try
            expr=parse(line)
            ans=eval(Main,expr)
            if ans != nothing && line[length(line)] != ';'
                display("text/plain", ans)
                println()
            end
        catch(ex)
            Base.showerror(STDOUT,ex)
            println()
        end
    end
end
rlrepl()

Then in rlwrap's inputrc file (either $HOME/.inputrc or /etc/inputrc),
add/change the following:
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[5": history-search-backward
"\e[6": history-search-forward

Then, to invoke rlrepl.jl...

# OS/X Terminal and SSH session to Linux (Ubuntu):
rlwrap -pBlue -afoo -tdumb -H 'ju.hist' -l 'ju.log' -s 10000 julia
--no-history-file ~/bin/rlrepl.jl

You forego all the niceties of the new repl, but for me (who can't loose
the up/dn arrow) this works just like all my other repl/shell activities
(and I have a session log as well).

Hope that helps some of those other up/dn arrow history-search addicts out
there :).

Regards, Adrian









On Wed, Aug 20, 2014 at 3:04 PM, Carlos Becker <carlosbec...@gmail.com>
wrote:

> Hi Tim, yes, I do know about Ctrl-R, but it is much lazier to use the
> up/down arrows, particularly when navigating history (otherwise you have to
> use Ctrl-R repeatedly, and Ctrl-Shift-R to go back).
>
> El miércoles, 20 de agosto de 2014 00:39:33 UTC+2, Tim Holy escribió:
>
>> You know about the Ctrl-r shortcut though, right?
>> --Tim
>>
>> On Tuesday, August 19, 2014 10:57:19 PM Carlos Becker wrote:
>> > Hi all,
>> >
>> > I think this is a typically asked question, but I don't know whether it
>> is
>> > possible now in julia v0.3.
>> > Namely to make the up/down arrows search completion history in the
>> REPL. If
>> > so, I will be happy to document it in the docs in the FAQ section.
>> >
>> > Thanks.
>> >
>> > ------------------------------------------
>> > Carlos
>>
>>

Reply via email to