Fix the bug reported by Alexander Skwar: bash applies all invisible characters to the first line instead of the ones that actually (dis)appear in that line. I've also pushed this upstream. http://bugs.gentoo.org/36393 --- bash-3.0/lib/readline/display.c +++ bash-3.0/lib/readline/display.c @@ -258,23 +258,21 @@ #endif { *r++ = *p; - if (!ignoring) + if (!ignoring) rl++; /* visible length byte counter */ - else - ninvis++; /* invisible chars byte counter */ + else + { + ninvis++; /* invisible chars byte counter */ + if (rl < _rl_screenwidth) + invfl = ninvis; + } } - if (rl >= _rl_screenwidth) - invfl = ninvis; - if (ignoring == 0) physchars++; } } - if (rl < _rl_screenwidth) - invfl = ninvis; - *r = '\0'; if (lp) *lp = rl;