delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/05/07/13:44:07

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
connect(): No such file or directory
From: Hans Horn <hannes AT 2horns DOT com>
Subject: Re: Resizing a terminal window
Date: Fri, 07 May 2010 10:43:41 -0700
Lines: 76
Message-ID: <hs1jge$d9c$1@dough.gmane.org>
References: <e8rljbzahnf DOT fsf AT FLM000025LVE9F DOT catmktg DOT com> <4BE0903A DOT 3030207 AT towo DOT net> <e8r6332e5ao DOT fsf AT FLM000025LVE9F DOT catmktg DOT com> <hrs3hq$3pj$1 AT dough DOT gmane DOT org> <e8raasb8wqc DOT fsf AT FLM000025LVE9F DOT catmktg DOT com>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4
In-Reply-To: <e8raasb8wqc.fsf@FLM000025LVE9F.catmktg.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

David,

This took me forever to figure out!

'expect' does not forward SIGWINCH 
(http://en.wikipedia.org/wiki/SIGWINCH) unless told to do so.

Add the following snippet (between lines marked with 
###################) to the beginning of your 'expect' script:

#!/bin/sh
# \
exec expect -f "$0" ${1+"$@"}

###################
trap { # trap sigwinch and pass it to the child we spawned
   set rows [stty rows]
   set cols [stty columns]
   stty rows $rows columns $cols < $spawn_out(slave,name)
} WINCH
###################

set host [lindex $argv 0]
...

I use this to log on from cygwin to various AIX and LINUX machines.

Good luck and let me know how goes,
Hans

On 5/7/2010 10:09 AM, J. David Boyd wrote:
> Hans Horn<hannes AT 2horns DOT com>  writes:
>
>> On 5/5/2010 8:28 AM, J. David Boyd wrote:
>>> Thomas Wolff<towo AT towo DOT net>   writes:
>>>
>>>> Am 04.05.2010 16:03, schrieb J. David Boyd:
>>>>> ...
>>>>>
>>>>> Locally, I can use the mouse to resize a window, and the $COLUMNS and
>>>>> $LINES variables are automatically filled in.
>>>>>
>>>>> On many remote xterm sessions, they aren't.
>>>>>
>>>>> Does anyone have any idea where to start figuring out what is wrong, and
>>>>> what I can do to correct it?
>>>>>
>>>> LINES and COLUMNS are legacy mechanisms which may serve as a
>>>> workaround if the system doesn't otherwise handle screen size changes
>>>> properly. They should not be needed on modern systems where the tty
>>>> driver maintains the information.
>>>> (You may note that mintty has not set them initially but they get set
>>>> on resize - by whatever means... - while in a cygwin console they are
>>>> not used at all.)
>>>> So if you happen to have these variables set on a system which does
>>>> not maintain them, they don't get changed on resize and confuse your
>>>> environment. In most cases the best remedy is to just unset them -
>>>> does that help?
>>>>
>>>> ------
>>>> Thomas
>>>
>>> Sadly enough, the system I am connecting to, SUSE Linux, does use them,
>>> and the checkwinsize shopt BASH function, but, somehow, not
>>> correctly....
>>
>> Just for curiosity: are you using 'expect' to log to the remote system?
>> If so, you'd need you modify your expect script to handle SIGWINCH
>> properly. Let me know...
>> H.
>
> Yes I am.   I use expect to login, then go interactive.   There is a
> flag/setting to monitor SIGWINCH?
>
> Tell me, please!!!



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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