<<< Date Index >>>     <<< Thread Index >>>

Re: [Mutt] #2988: Mutt should recognize tab (width)



On Tue, 27 Nov 2007, Rocco Rutte wrote:

Hi,

* Thomas Dickey wrote:
In mutt_strwidth() there's a check for printable chars which excludes tab
chars resulting in a width of 1. However, this is likely not the display
width resulting in wrong wrapping and possibly other undesired effects.

It's also important to check for tab, because more than one release of Solaris has some breakage in ctype for this character, categorizing it as a printable character...

Is there some easy way to do that? I've seen that termcap has various tab-related entries which could be used to guess more accurately what a string looks like on terminal. Or is there such a method already?

Not reliably. terminfo/termcap have the "it" (init_tabs) value, but
it's not widely used outside of (n)curses.

If not, simply assuming a tab is 8 chars wide won't hurt much I think (strings should be at worst shorter than they could be).

That's the default.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net