in reply to Re: Interactive post-coloring of readline input?
in thread Interactive post-coloring of readline input?

Thanks, but maybe a misunderstanding.

I'm using the debugger as a shell/REPL and want to highlight perl keywords while I'm typing them.

DB<100> print $a;

DB<101> prin█

So my question is rather how to hook into Term::ReadLine::Gnu to intercept finished words and surround them with the help of Term::ANSIColor.

I'm not sure what for you use Term::ReadLine in your example...

Cheers Rolf

  • Comment on Re^2: Interactive post-coloring of readline input?

Replies are listed 'Best First'.
Re^3: Interactive post-coloring of readline input?
by andal (Hermit) on Feb 09, 2012 at 10:14 UTC

    Actually, you should spend your time reading the manuals for Readline library. For example here .

    Once you understand, which facilities the library provides for interacting with the users input, you should be able to find appropriate front-end functions in Perl. I see there functions like rl_insert_text, rl_delete_text which lead me to belief, that it is possible to do what you want. But personally I've never tried to do it.

      > Actually, you should spend your time reading the manuals for Readline library.

      Actually RTFM is how I spend most of yesterday. :(

      Readline is a fairly rich editor-like application ...

      FWIW hooking into rl_event_hook() is my best bet so far.

      Cheers Rolf