irssi-import / bugs.irssi.org

bugs.irssi.org archive
https://github.com/irssi/irssi/issues
0 stars 0 forks source link

Wrong string length calculation for paste_prompt #782

Open irssibot opened 13 years ago

irssibot commented 13 years ago

If you change paste_prompt to include color codes, the cursor is placed too far to the right after printing the prompt, indicating that strlen is calculated using the number of bytes in the string, not the number of actually printed characters.

irssibot commented 13 years ago

This probably affects all operating systems, it would seem odd if this were OS dependant, but I entered OpenBSD since this is the only OS I've been able to try it on.

irssibot commented 12 years ago

Yep, running into the same issue with a theme I am trying to create.

There are other, possibly related bugs with input-prompt width calculations, when Unicode is included in status bar items before the prompt itself. For instance, my timestamp format includes Unicode characters, and there's a timestamp status bar item before the input area on my prompt bar; this causes odd mis-calculation bugs on the width, such as the first character of input “overlapping” the last character of the timestamp (but only sometimes; it “flickers” as things redraw, and sometimes the input prompt overrides the timestamp, and sometimes vice-versa.) Some relevant screenshots:

• A correct, “normal” prompt (which appears immediately after switching windows): http://ell.io/iVNeu • One form of broken prompt: http://ell.io/iafJT • Another: http://ell.io/iDGEg • Reproducing Christopher's colour-code concerns: http://ell.io/iTRhb