Subject: Re: Couple of nits about Cygwin
From: Chris Faylor <[email-masked]>
To: [email-masked]
Cc: DJ Delorie <[email-masked]>
Date: Tue, 25 Jul 2000 21:37:50 -0400

On Tue, Jul 25, 2000 at 08:19:22PM -0400, DJ Delorie wrote:
>
>>  1. When you start a bash shell, the cursor flashes at a reasonable 
>> rate, but when you start typing it generally disappears from view. 
>
>Found it.  WriteFile() to the console causes the cursor to dissapear
>for a bit.  Setting the cursor position makes it show up again.  Try
>the attached patch (I'll try it myself later, but the machine is in
>the middle of a big build I don't want to interrupt).

That seems to do it.  Thanks!  This problem has plagued Cygwin for
years.

I think it makes more sense for this to be in fhandler_console::read,
though.  Otherwise you're forcing the cursor to track every write, which
probably defeats the purpose of making it invisible for a while.

Putting it in the console read part means that the cursor is made
visible when cygwin is ready to receive input.

The change below just moves your code to the input part of cygwin rather
than the output.  It seems to work as well as putting it in the write
part.

Thanks again.  This problem was particularly noticeable on Windows 2K.
I've been meaning to investigate it for a while.

cgf

Index: fhandler_console.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_console.cc,v
retrieving revision 1.11
diff -u -p -r1.11 fhandler_console.cc
--- fhandler_console.cc	2000/07/10 23:08:45	1.11
+++ fhandler_console.cc	2000/07/26 01:35:49
@@ -145,6 +145,7 @@ fhandler_console::read (void *pv, size_t
       if ((bgres = bg_check (SIGTTIN)) <= 0)
 	return bgres;
 
+      cursor_rel (0,0); /* to make cursor appear on the screen immediately */
       switch (WaitForMultipleObjects (nwait, w4, FALSE, INFINITE))
 	{
 	case WAIT_OBJECT_0:

--
Want to unsubscribe from this list?
Send a message to [email-masked]