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

Re: beta12: 8-bit-cleanliness



>hmm.. looks to me like the correct thing is appearing in the history,
>it's just getting messed up on print out.  There's a routine called
>nicefputs() which formats history lines for display:  it does an
>isprint() check on each character.  This returns false for printable
>8-bit characters.  Now, the shell doesn't know whether the terminal
>can print 8-bit characters or not.  But that's not the full problem,
>since for characters over 128 which it doesn't think are printable, it
>just strips off 0x40 and prints it anyway.

Odd, I would have thought isprint() would get it right.

>Here's my suggestion:  assume we can print 8-bit chars, but handle
>anything in the range of control characters + 128 separately by
>sticking \M- in front.  (They're likely to get messed up inside zsh
>anyway; one day they might work, though.)  The following is about the
>best we can easily do.

That's a good solution.  When I modified nicefputs() etc. recently I
deliberately didn't bother handling 8-bit characters, because zsh isn't
8-bit clean.  I would rather have a proper fix, recognising which
characters are *really* printable, but this is a reasonable solution
for unprintable characters.

You'll want to modify nicestrlen() as well.

-zefram



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