delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/01/08/11:02:51

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <20020108160012.7035.qmail@web13402.mail.yahoo.com>
Date: Tue, 8 Jan 2002 08:00:12 -0800 (PST)
From: Greg Fenton <greg_fenton AT yahoo DOT com>
Subject: bash 2.05a.0(2) console "misbehaving" on w2k
To: cygwin AT cygwin DOT com
MIME-Version: 1.0

I recently upgraded BASH (don't know the previous version I had...).

Now when I run some programs, BASH misbehaves.

In particular, I have two programs which stand out:

Using the command-line P4 to submit, P4 calls vim to edit my
submission entry.  Prior to the upgrade, everything worked flawlessly.
Now, when in VIM, the console is all messed up.  VIM does not
appear in Command Mode at all.  I start off in what appears to
be Insert Mode, but hitting ESC does not take me into Command Mode.

At first I thought that it might be VIM, but switching my P4EDITOR
value to another VI (Watcom VI), I get the exact same (bad) behaviour.

A second program is one I wrote myself.  I have code which clears
the console (works fine on the W2K "command prompt" consoles), and
it used to work fine in bash.  Since the upgrade, bash now seems
to have some type of buffering problem.  The screen clears, but
calls to printf(), fflush(stdout) and getch() get all confused.
Again, the program works fine in the W2K command shell.

The code I use to clear the screen is below.  I need to use code
which will work in the NT command shell as well as Cygwin's.

----
void ConsoleClear( void )
{
    HANDLE handle;
    CONSOLE_SCREEN_BUFFER_INFO info;
    COORD coord;
    DWORD dwTemp;

    SECURITY_ATTRIBUTES attr;
    attr.nLength = sizeof( attr );
    attr.lpSecurityDescriptor = NULL;
    attr.bInheritHandle = TRUE;

    coord.X = 0;
    coord.Y = 0;

    handle =  CreateFile( TEXT("CONOUT$"),
                          GENERIC_READ|GENERIC_WRITE,
                          FILE_SHARE_READ|FILE_SHARE_WRITE,
                          &attr,
                          OPEN_EXISTING,
                          (DWORD)0,
                          (HANDLE)0 );

    if( handle != INVALID_HANDLE_VALUE )
    {
        if( GetConsoleScreenBufferInfo( handle, &info ) )
        {
            // Fill the console with the space character starting from
0,0
            FillConsoleOutputCharacter( handle, (TCHAR)' ',
                                        info.dwSize.X * info.dwSize.Y,
                                        coord, &dwTemp );
            // Put the cursor back the 0,0 position
            SetConsoleCursorPosition( handle, coord );
        }

        CloseHandle( handle );
    }
}

----

Suggestions as to what might be causing this?

Thanks in advance,
greg_fenton.

=====
Greg Fenton
greg_fenton AT yahoo DOT com

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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