delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/10/07/15:44:26

From: lhall AT rfk DOT com (Larry Hall RFK Partners Inc)
Subject: Re: color problem when not using bash
7 Oct 1998 15:44:26 -0700 :
Message-ID: <3.0.5.32.19981007183228.00af1bb0.cygnus.cygwin32.developers@pop.ma.ultranet.com>
References: <361BCEA4 DOT C7444135 AT cityweb DOT de>
Mime-Version: 1.0
To: Corinna Vinschen <corinna DOT vinschen AT cityweb DOT de>,
cygwin32-developers AT cygnus DOT com

At 10:27 PM 10/7/98 +0200, Corinna Vinschen wrote:
>Hi Larry,
>
>Larry Hall wrote:
>> If you are right about the call to fillin_info(), then I would suggest
>> removing the line to set the default_color completely.  It would just be
>> misleading and also unnecessary then.  However, you should be sure this is
>> the case since, if its not, your change will change the user's foreground
>> color to white, regardless of what its been set to by the user.  This may
>> not be an obvious problem on 9x, where the DOS box has no way to alter the
>> default colors but it is an issue on NT (or perhaps with 4DOS either place.)
>
>Don't ask me about 9X (sounds like a insect-powder :-) ), but while
>searching for the reason of the effect, I have inserted debug_printf's
>into the code of fillin_info(). There are many calls to fillin_info(),
>when starting tcsh. and the first 80% are with output_handle_ = NULL.

Hm, doesn't sound very efficient to me!;-)

>Another interesting info (I hope):
>I have done the same on an older version of winsup (980812, I think,
>anyway, the fhandler_console code is the older one), which doesn't
>have the color problem, and I could see, that the count of calls to
>fillin_info() with output_handle_ == NULL are much less, than with
>the newer version! It seems, that the constructor is called twice
>the times in the new version, but I havn't count it.

Also interesting.

>> [...]
>> I merely used the preexisting code as a guide to where I should
>> change things.  As a result, it is possible that the call to fillin_info()
>> in the constructor is unnecessary.  But, as I said, if this is really the
>> case, then any setting for default_color is too.
>
>I agree.
>I'm sure, it's unnecessary, because output_handle_ will be
>set at method open(), which already calls fillin_info().
>If you comment out the calls in constructor, not one call to
>fillin_info() with output_handle_ == NULL is to be seen in the
>debugging output and the count of calls to fillin_info() with
>output_handle_ != NULL remains the same. I didn't want to be pert,
>but IMHO, the call only kills time and unnecessery code confuses,
>if one looks at it. I first thought, this NULL calls are the
>problem.

Yup, I looked at the open() call too and that's where the "init" of
default_color should and is happening.  There's obviously no need to
set this in any way, shape, or form in the constructor.  I see no
problem with pulling this out of the constructor code.

>Unfortunately, they are not the problem and I don't realize the
>difference in color processing between the old and the new version
>of class fhandler_console. The relevant code for this seems to be
>nearly identical. This is valid for the term=linux/ansi problem, too.

Hm, maybe I can check the differences in this file from 8/12 to now although
if you don't see a difference, I doubt I will either.  Something else
related may have been changed...

>The big difference between bash and tcsh seems to be, that bash uses
>the readline lib and tcsh only uses ncurses.
>
>I don't understand it... Sigh (once more)!

Yes, I'm not sure I do either...

>Bye,
>Corinna
>
>P.S.: You don't want to have tcsh for testing, do you?

Well, maybe.  Assuming I was going to be able to play around with this
much, do you think it would be better to scoff this from someone, like
yourself, or is it just as good/easy to build it?  Obviously I haven't
tried this and wouldn't want to get too bogged down in the details of
doing so.  However, I could foresee the possibility that resolving any 
issue here would require the ability to debug tcsh too...


Larry Hall                              lhall AT rfk DOT com
RFK Partners, Inc.                      (781) 239-1053
8 Grove Street                          (781) 239-1655 - FAX
Wellesley, MA  02482-7797               http://www.rfk.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019