[colug-432] terminal resizing notification?

Rick Hornsby richardjhornsby at gmail.com
Thu Mar 28 14:41:54 EDT 2013


Trying to understand the relationship between resizing a terminal, stty,
and how the remote side gets that information that the window has been
resized.

The issue is that I can ssh into a linux host with no issues, resize my
window all day long and the remote side sees the resize (confirmed by stty
-a | grep row).

However, we have a very small expect wrapper that we use most of the time
to log in.  The expect wrapper goes to a credential store to fetch the
password (yeah, I know, public keys, etc ... that's a long story), and
passes the password to the prompt.

When I use the expect wrapper to log in, the remote side never sees the
resize.  I can manually set the window size using stty, but I'm unclear on
why wrapping it in expect is causing this issue.  The terminal type is the
same in both cases, and I've confirmed this behavior in two different
terminal applications (Terminal.app and iTerm2).

How does the remote side know about the resize?  Is it some kind of
backchannel communication, or is there some kind of escape code getting
sent?

This is the essence of the expect script, if it helps put it in context:

---
spawn -noecho ssh -o PubKeyAuthentication=no -o StrictHostKeyChecking=no
root@$host $cmd

expect "?*password?*"
send "$passwd\r"

interact

exit 0
---

(yes -- first rule -- never, ever log in as root -- if I could get my giant
company with our 10s of thousands of servers to understand that life would
be much easier.)

the $cmd part is ignored if it wasn't provided.

termtype all that behind the scenes stuff re a terminal is a topic I
admittedly don't understand very well.

thanks
-rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.colug.net/pipermail/colug-432/attachments/20130328/6cc0ecc0/attachment.html 


More information about the colug-432 mailing list