Re: RFS: bashish -- Theme environment for text terminals
2006/7/15, Adam Borowski <email@example.com>:
On Sat, Jul 15, 2006 at 10:03:56PM +0200, Thomas Eriksson wrote:
> 2006/7/15, Adam Borowski <firstname.lastname@example.org>:
> >on many terminals, some of bashish themes don't work well, miss some
> >glyphs, etc. This kind of things is impossible to detect -- at least
> >not in any portable or semi-portable way. And termcap/terminfo are
> >just bad jokes.
> Yup, currently most fancy prompts in Bashish are hardcoded in UTF-8
> Let's see if I can hack together better 8859-1 support for 2.0.6
What I meant is that it's impossible to tell whether a given glyph is
present; downgrading to an 8-bit encoding can't help.
If you want to bother with supporting ancient charsets, utfness
actually _can_ be detected. In two ways:
1: checking the locale:
return !strcmp(charset_name, "UTF-8");
This relies on the user setting his locale set correctly -- but this
way is consistent with the vast majority of software in Debian.
Too bad, I'm unsure how to do this from shell. You can't check for
locales ending in .UTF-8, as this won't catch vi_VI, or, if gods and
the release team get reasonable, en_US or pl_PL in the near future.
Yay, my initial plan! Guess I'll have to settle with plan B
2. writing something to the terminal:
This doesn't rely on the locale support.
Thanks for the code, but this C programming language you're talking
about seems messy, rewriting in ksh88... :)
And, the whole exercise is sort of pointless -- you need UTF-8 for
block graphics, which is NOT SUPPORTED IN ISO-8859-* ANYWAY. That
said, you can often switch to the IBM charset (dubbed "cp437" by a
certain unrelated company) with "\e[11m" and go back with "\e[10m".
The idea with the artwiz fonts and the quasi-legal luconP.ttf is to
load a CP437 font with ISO8859-1 encoding.
Probably the same will work by loading an old VGA font in the Linux console.
While I'm currently on my crusade to make the entire world use UTF-8,
this isn't happening soon (few terminal emulators support it
adequatly, and does OpenBSD/NetBSD even support it btw?)
So, detecting utfness just to tell them they can go to hell is not
worth your effort :p
If utfness is available they will get utf-8 characters, if not they
get the quasi-CP437 version.
They need not go to hell, just switch theme if things does not look right :)
> I really appreciate reviews or bug-reports of Bashish. Having Bashish
> in Debian would be really cool, but perhaps there are some features
> lacking now.
> If no one steps up to sponsor it right away, I'll just regulary upload
> packages anyway to http://mentors.debian.net :)
Just uploading to mentors doesn't work, I'm afraid. There is much
more sponsorees than sponsors, so no one appears to check old RFS or
listings such as sponsors.debian.net
Well eventually, one of the DD's find Bashish useful and care to
sponsor it. I'll put up a big sign about it at