Re: Readline behavior with colored custom prompt

2016-02-25 Thread Nala Ginrut
Are you looking for something like guile-colorized? https://github.com/NalaGinrut/guile-colorized On Thu, 2016-02-25 at 12:20 -0500, Matthew Keeter wrote: > Hi all, > > I’m seeing strange behavior with readline's interaction with ANSI codes. > > Here’s a minimal sample script that reproduces th

Re: Readline behavior with colored custom prompt

2016-02-25 Thread Matthew Keeter
Figured it out, after a bit more searching – it’s purely due to readline's behavior. readline obeys the magic characters \x01 and \x02, ignoring anything in between then when calculating prompt length. Wrapping the escape sequences makes everything behave correctly. (similar bug: https://bugs.

Re: Readline behavior with colored custom prompt

2016-02-25 Thread Matthew Keeter
I think the fundamental issue is incorrect prompt length calculation, since it’s not just bounce-parens: even with that turned off, scrolling through history ends up printing weird mismatched lines. Here’s a similar issue discussed in nodejs: https://github.com/nodejs/node-v0.x-archive/issues/38

Readline behavior with colored custom prompt

2016-02-25 Thread Matthew Keeter
Hi all, I’m seeing strange behavior with readline's interaction with ANSI codes. Here’s a minimal sample script that reproduces the behavior: (use-modules (system repl repl) (system repl common)) (use-modules (ice-9