delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/10/07/02:48:09

From: corinna DOT vinschen AT cityweb DOT de (Corinna Vinschen)
Subject: color problem when not using bash
7 Oct 1998 02:48:09 -0700 :
Message-ID: <361B37EF.194BDE3A.cygnus.cygwin32.developers@cityweb.de>
Mime-Version: 1.0
To: cygwin32-developers AT cygnus DOT com

Hi,

I have already spoken about the problem, but it's not
removed.

I'm using tcsh 6.07.02 as shell and it's compiled without any
special CYGWIN code. The effect is since winsup-980914.

Imagine the follow:

The factory default colors of the Win console window are grey
font on black background. Let's name it FC (factory color).

I now change it to, say sth., black font on light yellow ground.
Name it OC (own color).

CYGWIN32=binmode ntea notty
so `tty' gives: /dev/conin.

Now starting tcsh.

-> All screen has OC.

Hitting `X' and then backspace.

-> Right of the cursor now is FC.

Starting `vi'.

-> The text is OC, all blanks (esp. at the right of the text) are FC.

Starting `clear'.

-> All screen is FC.

While trying to find the problem in fhandler_console.cc, I have
only figured out, the the method fhandler_console::fillin_info()
is also called in constructor. This is definitely unnecessery,
because at this time, output_handle_ is NULL. But the real
solution??? Sigh!

Another problem is, that, while correcting the input line,
if one moves the cursor to the left, and then inserts chars,
the rest of the line is not be moved to the right. This
also happens in mode CYGWIN32='... tty ...'.
But if you change TERM to 'ansi',  this effect never
occures again.

Corinna

The diff, to avoid unnecessary calls to fillin_info():
---- snip ----
*** fhandler_console.cc.orig    Wed Oct 07 10:12:11 1998
--- fhandler_console.cc Wed Oct 07 10:14:45 1998
*************** 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;
  }

  /*
--- 406,412 ----
    set_cb (sizeof *this);
    iflag_ = lflag_ = nargs_ = 0;
    state_ = normal;
!   default_color = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED;
  }

  /*

- Raw text -


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