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/3860

Any suggestions where to look for prompt length calculations?
I flipped through guile-readline/readline.c but didn’t see any obvious places to apply a fix.

Thanks,
Matt

On Feb 25, 2016, at 1:05 PM, Mike Gran <spk121@yahoo.com> wrote:




On Thursday, February 25, 2016 9:21 AM, Matthew Keeter <matt.j.keeter@gmail.com> wrote:


Run this and you’ll get a Guile shell.  Into that shell, type

  '(1 2 3 4 5 6 7 8 9 10)

The final parenthesis will highlight a character midway through the string
(instead of the first parenthesis).

The same issues happen if you try to scroll through history: lines end up
overlapping in strange ways.

Removing the ANSI codes from custom-prompt resolves the issue, but I’d really
like to have a colored prompt and correct readline behavior.

Does anyone have any ideas?

The conflict is likely between your codes and the bounce-parens functionality
of the readline prompt.

(readline-set! bounce-parens 0)  should disable that functionality and make the
colored prompt work.

To get your escape sequences and bounce-parens working would probably require
more thinking...

-Mike