This is the mail archive of the cygwin 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]

RE: Line breaks in bash


> From: Ashok Vadekar
> Sent: Friday, April 23, 2004 5:13 PM

> It was XP in my case.  The stty -a followed by a kill -WINCH
> my-bash-pid works (even with a mode.com based resize).
>  Thanks for the insight.  I hope the original poster gets
> something out of this too.

Trying to add some more traces...

> On Fri, Apr 23, 2004 at 11:13:05AM -0400, Igor Pechtchanski wrote:
> > Which OS?  Win9x console is pretty much braindead.  Cygwin's programs
> > (notably bash) have code for processing a SIGWINCH, which they should
> > receive whenever a window (console or otherwise) that they're running in
> > gets resized.  However, the code for sending this signal will
> only detect
> > a *window* resize -- I don't know whether the one via
> "mode.com" will also
> > be detected[*].  Try "kill"ing bash with SIGWINCH.  Also, bash
> doesn't use
> > the COLUMNS/ROWS variables, it looks at the same info that stty gets --
> > run "stty -a" and see if it picks up the window size.
> > 	Igor
> > [*] It is on Win2k, FWIW.

When using $COLUMNS and/or $LINES in bash startup scripts I've had to do the
following to get somewhere...
 The problem has seemed (to me) be a delay before the env-vars get set. i.e:
It is problematic to attempt to use $COLUMNS/$LINES before the bash prompt
has appeared for the first time (Using cygwin+W2K on an P2@450MHz if that
matters).

-- snip --

# Make bash reread console COLUMNS and LINES
kill -WINCH $$
kill -WINCH $PPID
if [ -z $COLUMNS ] ;then
        echo 1>&2 "${0##*/}: WARNING; \
        \$COLUMNS unset in bash (PID:$$) dispite sending SIGWINCH!"
fi

-- snip --




/Hannu E K Nevalainen, B.Sc. EE - 59+16.37'N, 17+12.60'E

** on a mailing list; please keep replies on that particular list **

-- printf("LocalTime: UTC+%02d\n",(DST)? 2:1); --
--END OF MESSAGE--


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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]