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

Re: Colors showing when TERM=dumb.



On Sun, 4 Mar 2012 22:35:42 -0800
John Gregorski <jfgorski@xxxxxxxxx> wrote:
> While playing around with my prompt I noticed that when TERM=dumb,
> stuff like %B %U %S have no effect, but %F %K still print out terminal
> escapes. Is this a bug? To work around it, I hacked putpromptchar in
> prompt.c like this:

It's not quite that simple, since actually for named colours we just
output the ANSI sequences as the best guess for what's likely to produce
those, since the mapping from names to numbers isn't defined by termcap.
That will happen regardless of termcap.  So turning them off works, too.

Howver, obviously if you're not outputting termcap, then there's no
point outputting anything resetting it.  I'm not sure what a general fix
is.  Hmm... we keep track of what we've changed, maybe we could keep
track of termcap and ANSI colour handling separately; then your change
would apply with an additional check that we didn't have the bit for
ANSI colour handling set.

I don't think you could take that there's a guarantee that any kind of
terminal, even dumb, doesn't output terminal sequences, however, even
though I can see that could be useful.  That would need a special case
we don't have at the moment.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog



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