Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: several bug fixes in countprompt



This patch fixes multiple bugs in countprompt.

1. Height off by one in the presence of meta characters at the end of the line.

The following prompt has height 2 but countprompt used to return 3.

    PROMPT="${(pl.$COLUMNS..-.)}%f"$'\n'

You can observe the effects of the bug by hitting esc-x followed by
reset-prompt.

2. Width off by one when a line is broken in the middle of a wide character.

Assuming COLUMNS=79, the following prompt has width 2 but countprompt
used to return 0. Note that \u3050 has width 2.

    PROMPT="${(pl.40..\u3050.)}" zsh -df

Press ctrl-r or type ls<tab> to observe the effects of the bug.

3. Width off by 1-7 when a line is broken in the middle of a tab.

Assuming COLUMNS=79, the following prompt has width 1 but countprompt
used to return 0.

    PROMPT="${(pl.10..\t.)}" zsh -df

Press ctrl-r or type ls<tab> to observe the effects of the bug.

On github: https://github.com/zsh-users/zsh/compare/master...romkatv:countprompt-fix.

I've only tested it on one terminal. Before I test it on a dozen of
different terminals, is there anything I'm missing? Anything I should
be on lookout for?

Roman.

Attachment: countprompt-fix.patch
Description: Binary data



Messages sorted by: Reverse Date, Date, Thread, Author