<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 28, 2013 at 4:31 PM, Jeff Frontz <span dir="ltr"><<a href="mailto:jeff.frontz@gmail.com" target="_blank">jeff.frontz@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Yeah, someone else ran into this:<br>
<a href="http://ubuntuforums.org/showthread.php?t=865420" target="_blank">http://ubuntuforums.org/showthread.php?t=865420</a><br>
<br>
Summary: "You have to trap SIGWINCH in your expect script and<br>
propagate this to the child."</blockquote><div><br></div><div><br></div><div style>Trapping the signal did the trick. Thanks!</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5">
> I always thought it was SIGWINCH that prompted an app (or, rather, its<br>
> library) to go out and query the terminal for [potentially] new<br>
> dimensions. And I'm guessing the "query" is dependent on the TERM<br>
> type-- which, if I remember correctly, is sent over by ssh on<br>
> interactive login.<br>
><br>
> When you're running it with "expect", what environment variables are<br>
> you seeing on the remote?<br>
</div></div></blockquote><div><br></div><div style>all of the normal variables seem to be there like</div><div style><br></div><div style>TERM=xterm-256color<br></div><div style>SSH_TTY=/dev/pts/0<br></div><div style><br>
</div><div style>etc</div><div><br></div><div><br></div><div style>thanks again!</div><div style>-rick</div><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5">><br>
><br>
> Jeff<br>
><br>
><br>
><br>
> On Thu, Mar 28, 2013 at 2:41 PM, Rick Hornsby <<a href="mailto:richardjhornsby@gmail.com">richardjhornsby@gmail.com</a>> wrote:<br>
>><br>
>> Trying to understand the relationship between resizing a terminal, stty, and<br>
>> how the remote side gets that information that the window has been resized.<br>
>><br>
>> The issue is that I can ssh into a linux host with no issues, resize my<br>
>> window all day long and the remote side sees the resize (confirmed by stty<br>
>> -a | grep row).<br>
>><br>
>> However, we have a very small expect wrapper that we use most of the time to<br>
>> log in. The expect wrapper goes to a credential store to fetch the password<br>
>> (yeah, I know, public keys, etc ... that's a long story), and passes the<br>
>> password to the prompt.<br>
>><br>
>> When I use the expect wrapper to log in, the remote side never sees the<br>
>> resize. I can manually set the window size using stty, but I'm unclear on<br>
>> why wrapping it in expect is causing this issue. The terminal type is the<br>
>> same in both cases, and I've confirmed this behavior in two different<br>
>> terminal applications (Terminal.app and iTerm2).<br>
>><br>
>> How does the remote side know about the resize? Is it some kind of<br>
>> backchannel communication, or is there some kind of escape code getting<br>
>> sent?<br>
>><br>
>> This is the essence of the expect script, if it helps put it in context:<br>
>><br>
>> ---<br>
>> spawn -noecho ssh -o PubKeyAuthentication=no -o StrictHostKeyChecking=no<br>
>> root@$host $cmd<br>
>><br>
>> expect "?*password?*"<br>
>> send "$passwd\r"<br>
>><br>
>> interact<br>
>><br>
>> exit 0<br>
>> ---<br>
>><br>
>> (yes -- first rule -- never, ever log in as root -- if I could get my giant<br>
>> company with our 10s of thousands of servers to understand that life would<br>
>> be much easier.)<br>
>><br>
>> the $cmd part is ignored if it wasn't provided.<br>
>><br>
>> termtype all that behind the scenes stuff re a terminal is a topic I<br>
>> admittedly don't understand very well.<br>
>><br>
>> thanks<br>
>> -rick<br>
>><br>
>> _______________________________________________<br>
>> colug-432 mailing list<br>
>> <a href="mailto:colug-432@colug.net">colug-432@colug.net</a><br>
>> <a href="http://lists.colug.net/mailman/listinfo/colug-432" target="_blank">http://lists.colug.net/mailman/listinfo/colug-432</a><br>
>><br>
_______________________________________________<br>
colug-432 mailing list<br>
<a href="mailto:colug-432@colug.net">colug-432@colug.net</a><br>
<a href="http://lists.colug.net/mailman/listinfo/colug-432" target="_blank">http://lists.colug.net/mailman/listinfo/colug-432</a><br>
</div></div></blockquote></div><br></div></div>