TIOCGWINSZ and busybox

Dave Hylands dhylands at gmail.com
Sun Mar 11 15:04:38 UTC 2007


Hi Denis,

> > I did run the resize code (not from busybox, just from regular ole'
> > resize) and the ioctl fails there too (of course).  "Regular" Resize
> > seems to use some magic then to guess at the new row and height, but it
> > seems to be correct.
>
> What magic? Can you show 'strace -o resize' output, or better yet,
> show the source of that other resize?

Here's a resize I got from Paul Fox a while back when this topic was raised:
<http://www.davehylands.com/gumstix-wiki/resize/>

The binaries are for the gumstix, so you can ignore those.

winsize.c just reports the current size using TIOCGWINSZ.

> I don't like it. resize does evil hacks in order to get terminal
> size (sends ESC sequences to terminal and reads response).
> These hacks shouldn't propagate into more/less/top etc...

more/less/top just issue the ioctl to get the current size so they
just work if resize was called by the init script..

-- 
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/



More information about the busybox mailing list