Skip to content
This repository has been archived by the owner on Apr 17, 2020. It is now read-only.

Wrong string length calculation for paste_prompt #782

Open
irssibot opened this issue Jan 10, 2011 · 2 comments
Open

Wrong string length calculation for paste_prompt #782

irssibot opened this issue Jan 10, 2011 · 2 comments

Comments

@irssibot
Copy link
Collaborator

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

irssibot commented Dec 1, 2011

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

1 participant