delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/10/14/17:51:58

From: corinna DOT vinschen AT cityweb DOT de (Corinna Vinschen)
Subject: diff to winsup981012, was Re: color problem when not using bash
14 Oct 1998 17:51:58 -0700 :
Message-ID: <36253B29.9C65EEC1.cygnus.cygwin32.developers@cityweb.de>
References: <3 DOT 0 DOT 5 DOT 32 DOT 19981009205612 DOT 00a87760 AT pop DOT ma DOT ultranet DOT com>
Mime-Version: 1.0
To: Larry Hall <lhall AT rfk DOT com>, cygwin32-developers AT cygnus DOT com

Hi Larry, hi all,

I have found the solution for the color problem in the
newer winsups, also the b20alpha-releases.

The newer winsups don't have an extra `linearize/de_linearize'
section for the class fhandler_console. This is really not
necessary, but unfortunately the console fhandler also forgets
its default colorizing, if it's `dup'ed. So, one extra line
of code clears the problem, the copying of member
`default_color' in case of method dup().

The second part of this diff is, erasing unnecessary but time
killing code in constructor of fhandler_console. 'Time killing',
because it's called very often.

Bye
Corinna

------ snip -------
*** fhandler_console.cc.orig    Thu Oct 15 00:57:18 1998
--- fhandler_console.cc Thu Oct 15 00:54:27 1998
*************** fhandler_console::dup (fhandler_base *ch
*** 207,212 ****
--- 207,213 ----

    fhc->set_output_handle (nh);
    fhc->state_ = state_;
+   fhc->default_color = default_color;

    return fhandler_base::dup (child);
  }
*************** fhandler_console::fhandler_console (cons
*** 406,415 ****
    set_cb (sizeof *this);
    iflag_ = lflag_ = nargs_ = 0;
    state_ = normal;
-   if (fillin_info ())
-     default_color = info.wAttributes;
-   else
-     default_color = FOREGROUND_BLUE | FOREGROUND_GREEN |
FOREGROUND_RED;
  }

  /*
--- 407,412 ----

- Raw text -


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