[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Configuring readline prompt
From: |
Peter Wright |
Subject: |
Re: [Chicken-users] Configuring readline prompt |
Date: |
Mon, 13 Mar 2006 17:02:58 +0800 |
User-agent: |
Mutt/1.4.2.1i |
On 13/03 08:44:40, felix winkelmann wrote:
> On 3/10/06, Peter Wright <address@hidden> wrote:
[ snip ]
> > Is there a way to include this sort of information in the readline
> > string defined with make-gnu-readline-port?
>
> I have added support for `(repl-prompt)' in the readline egg (if the
> prompt argument to make-gnu-readline-port is omitted, it uses that
> parameter). To have history access ("#NNN") you must invoke csi with
> "-:c" (history is only kept when stdin is a tty port).
Awesome. Thank you very much.
> If someone has a suggestion to handle this better, please tell.
There's only one minor glitch for me:
------------------ ~/.csirc ------------------
(require 'readline)
(current-input-port (make-gnu-readline-port))
(gnu-history-install-file-manager (string-append (or (getenv "HOME") ".")
"/.csi.history"))
------------------ ~/.csirc ------------------
But at the REPL, after running with "csi -:c" :
------------------ at the REPL ------------------
Version 2, Build 3 - linux-unix-gnu-x86 - [ dload ptables ]
(c)2000-2005 Felix L. Winkelmann
; loading /home/pete/.csirc ...
; loading /usr/lib/chicken/readline.so ...
#;1> #;1> 0
0
#;2> #;2>
#;2> 17
17
#;3> #;3>
------------------ at the REPL ------------------
As you can see, I get the #;n> sequence duplicated. When I hit enter
by itself, I got the single #;2> ... but then the dupe comes back at
prompt number three.
It works as you'd expect without the -:c flag, but (as you suggested)
the history number doesn't increment.
This is quite good enough even so, but I just thought I'd mention it. :)
> cheers,
> felix
Thanks again, I really appreciate it.
Pete.
--
http://flooble.net/blog
"The effect of reading an Unlambda program is like having your brains
smashed out by a Lisp s-expression wrapped around an ENIAC. You won't
find anything like it west of Alpha Centauri."
-- The Hitch-Hacker's Guide to Programming, discussing Unlambda