Please give me a hint how to manipulate Term::Readline output after it was already printed.
I suppose the trick is to send a control sequence which erases the line and reprints it.
My aim is to hack a proof of concept for syntax highlighting in the perl debugger when used interactively as a shell
From digging into perl5db.pl I can see that Term::Readline is used for reading and a hashref $rl_attribs is used to provide call-back functions like db_complete()
$rl_attribs->{completion_function} = \&db_complete;
So is it possible to provide a similar hook which reacts on word_break_characters and then surrounds the already printed word with control-sequences for coloring?
Examples typing "print" does nothing (printed black) but typing: "print " or "print(" activates a call back which modifies "print" to light blue.
Cheers Rolf
In reply to Interactive post-coloring of readline input? by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |