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

Re: Fw: Phil's prompt is not working when LANG is set to UTF-8



On Feb 15, 11:52pm, Peter Stephenson wrote:
}
} - Hence it falls foul of the multibyte tests.  In principle it
}   might clash with a UTF-8 character anyway and have the wrong
}   width, so assuming a width 1 for an unknown character is not
}   necessarily better than assuming width 0.

I agree with "not necessarily," but I suspect it'll be right more
often than wrong to assume 1.  *Most* characters are not going to be
"non-printing," and if the mb library doesn't recognize them, then
they're also unlikely to be simultaneously multibyte and handled
correctly by the terminal.

I'll bet I argued this the other way when this came up the last time,
but now we have some empirical results.

} How about the following tweak to prompts to support this? The upshot
} is that you include any funny characters in %{...%G%} where the %G for
} `glitch' (which may be repeated or take a numeric argument) indicates
} a screen cell taken up by the sequence.

I like this, but I'm wondering if it might not be better to have %{
accept a count, e.g., instead of %{...%6G%} just write %6{...%}.  Does
it matter where %G appears?  %{...%7G...%} ?  What if you use it more
than once, as in %{...%7G...%3G%} ?  Using a count on %{ might make it
more obvious that you should write %7{...%}%3{...%} if %7G%3G != %10G.



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