public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* bash 2.05a.0(2) console "misbehaving" on w2k
@ 2002-01-08  8:00 Greg Fenton
  2002-01-08 10:24 ` Larry Hall (RFK Partners, Inc)
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Fenton @ 2002-01-08  8:00 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bash 2.05a.0(2) console "misbehaving" on w2k
  2002-01-08  8:00 bash 2.05a.0(2) console "misbehaving" on w2k Greg Fenton
@ 2002-01-08 10:24 ` Larry Hall (RFK Partners, Inc)
  2002-01-08 15:57   ` Greg Fenton
  0 siblings, 1 reply; 8+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2002-01-08 10:24 UTC (permalink / raw)
  To: Greg Fenton, cygwin

At 11:00 AM 1/8/2002, Greg Fenton wrote:
>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?



Sounds like something or someone reset your TERM variable.



Larry Hall                              lhall@rfk.com
RFK Partners, Inc.                      http://www.rfk.com
838 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX


--
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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bash 2.05a.0(2) console "misbehaving" on w2k
  2002-01-08 10:24 ` Larry Hall (RFK Partners, Inc)
@ 2002-01-08 15:57   ` Greg Fenton
  2002-01-08 16:02     ` Larry Hall (RFK Partners, Inc)
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Fenton @ 2002-01-08 15:57 UTC (permalink / raw)
  To: cygwin

"Larry Hall (RFK Partners, Inc)" <lhall@rfk.com> wrote:
> 
> 
> Sounds like something or someone reset your TERM variable.
> 

$ echo $TERM
cygwin


That's the right value, correct?

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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bash 2.05a.0(2) console "misbehaving" on w2k
  2002-01-08 15:57   ` Greg Fenton
@ 2002-01-08 16:02     ` Larry Hall (RFK Partners, Inc)
  2002-01-08 16:16       ` Greg Fenton
  0 siblings, 1 reply; 8+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2002-01-08 16:02 UTC (permalink / raw)
  To: Greg Fenton, cygwin

At 06:57 PM 1/8/2002, Greg Fenton wrote:
>"Larry Hall (RFK Partners, Inc)" <lhall@rfk.com> wrote:
> > 
> > 
> > Sounds like something or someone reset your TERM variable.
> > 
>
>$ echo $TERM
>cygwin
>
>
>That's the right value, correct?


Yep, it is.  OK, maybe check your other terminal-related environment
variables to see if something looks off.  If not, I'm not sure what
the problem is.  But if it's affecting more than just Cygwin tools,
it has to be something like environment variables which all applications
can see, use, and change.



Larry Hall                              lhall@rfk.com
RFK Partners, Inc.                      http://www.rfk.com
838 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX


--
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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bash 2.05a.0(2) console "misbehaving" on w2k
  2002-01-08 16:02     ` Larry Hall (RFK Partners, Inc)
@ 2002-01-08 16:16       ` Greg Fenton
  2002-01-08 16:22         ` Larry Hall (RFK Partners, Inc)
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Fenton @ 2002-01-08 16:16 UTC (permalink / raw)
  To: cygwin

"Larry Hall (RFK Partners, Inc)" <lhall@rfk.com> wrote:
>
> Yep, it is.  OK, maybe check your other terminal-related environment
> variables to see if something looks off.  If not, I'm not sure what
> the problem is.  But if it's affecting more than just Cygwin tools,
> it has to be something like environment variables which all
> applications
> can see, use, and change.
> 

*SMACK!*

Thanks Larry for your replies...you've uncovered my foolishness...
I had added to the windows env a $CYGWIN setting when I last upgraded
BASH and had forgotten about it...sigh...

Thanks for your help!
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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bash 2.05a.0(2) console "misbehaving" on w2k
  2002-01-08 16:16       ` Greg Fenton
@ 2002-01-08 16:22         ` Larry Hall (RFK Partners, Inc)
  2002-01-09 11:39           ` Greg Fenton
  0 siblings, 1 reply; 8+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2002-01-08 16:22 UTC (permalink / raw)
  To: Greg Fenton, cygwin

At 07:16 PM 1/8/2002, Greg Fenton wrote:
>"Larry Hall (RFK Partners, Inc)" <lhall@rfk.com> wrote:
> >
> > Yep, it is.  OK, maybe check your other terminal-related environment
> > variables to see if something looks off.  If not, I'm not sure what
> > the problem is.  But if it's affecting more than just Cygwin tools,
> > it has to be something like environment variables which all
> > applications
> > can see, use, and change.
> > 
>
>*SMACK!*
>
>Thanks Larry for your replies...you've uncovered my foolishness...
>I had added to the windows env a $CYGWIN setting when I last upgraded
>BASH and had forgotten about it...sigh...
>
>Thanks for your help!


Glad to be of service!  Just out of curiosity, what was the environment
variable and the setting you added/were missing?



Larry Hall                              lhall@rfk.com
RFK Partners, Inc.                      http://www.rfk.com
838 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX


--
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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bash 2.05a.0(2) console "misbehaving" on w2k
  2002-01-08 16:22         ` Larry Hall (RFK Partners, Inc)
@ 2002-01-09 11:39           ` Greg Fenton
  2002-01-09 11:56             ` Larry Hall (RFK Partners, Inc)
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Fenton @ 2002-01-09 11:39 UTC (permalink / raw)
  To: Larry Hall (RFK Partners, Inc), cygwin


"Larry Hall (RFK Partners, Inc)" <lhall@rfk.com> wrote:
>
> At 07:16 PM 1/8/2002, Greg Fenton wrote:
> >
> >Thanks Larry for your replies...you've uncovered my foolishness...
> >I had added to the windows env a $CYGWIN setting when I last
> upgraded
> >BASH and had forgotten about it...sigh...
> [...]
> Glad to be of service!  Just out of curiosity, what was the
> environment
> variable and the setting you added/were missing?
> 

$ echo $CYGWIN
check_case:adjust title tty glob:ignorecase ntea

I haven't had a chance to lookup the reference for CYGWIN
to find out what this does...and I won't have time for a
while.

Thanks again,
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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: bash 2.05a.0(2) console "misbehaving" on w2k
  2002-01-09 11:39           ` Greg Fenton
@ 2002-01-09 11:56             ` Larry Hall (RFK Partners, Inc)
  0 siblings, 0 replies; 8+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2002-01-09 11:56 UTC (permalink / raw)
  To: Greg Fenton, cygwin

At 02:39 PM 1/9/2002, Greg Fenton wrote:

>"Larry Hall (RFK Partners, Inc)" <lhall@rfk.com> wrote:
> >
> > At 07:16 PM 1/8/2002, Greg Fenton wrote:
> > >
> > >Thanks Larry for your replies...you've uncovered my foolishness...
> > >I had added to the windows env a $CYGWIN setting when I last
> > upgraded
> > >BASH and had forgotten about it...sigh...
> > [...]
> > Glad to be of service!  Just out of curiosity, what was the
> > environment
> > variable and the setting you added/were missing?
> > 
>
>$ echo $CYGWIN
>check_case:adjust title tty glob:ignorecase ntea
>
>I haven't had a chance to lookup the reference for CYGWIN
>to find out what this does...and I won't have time for a
>while.


OK.  I'm still a little confused though.  I'm not aware of any settings
in the CYGWIN environment variable that should affect VIM and especially
not any non-Cygwin version.  So, I'm glad you think I helped but it's 
not clear to me from the information provided that there was any real
Cygwin link for this issue.

OK, I'll drop the thread since it seems OT.

Glad you found a fix for your problem though.



Larry Hall                              lhall@rfk.com
RFK Partners, Inc.                      http://www.rfk.com
838 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX


--
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/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-01-09 19:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-08  8:00 bash 2.05a.0(2) console "misbehaving" on w2k Greg Fenton
2002-01-08 10:24 ` Larry Hall (RFK Partners, Inc)
2002-01-08 15:57   ` Greg Fenton
2002-01-08 16:02     ` Larry Hall (RFK Partners, Inc)
2002-01-08 16:16       ` Greg Fenton
2002-01-08 16:22         ` Larry Hall (RFK Partners, Inc)
2002-01-09 11:39           ` Greg Fenton
2002-01-09 11:56             ` Larry Hall (RFK Partners, Inc)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).