This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bash 2.05a.0(2) console "misbehaving" on w2k


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@yahoo.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]