How do I get vi to know my window size?

Rob Landley rob at landley.net
Wed Sep 20 16:49:33 PDT 2006


On Wednesday 20 September 2006 3:51 am, Paul Fox wrote:
> i agree, though one might come up with a mechanism that could be turned
> on optionally by the calling program.

Actually, the correct place to do this is in bbsh when it's interactive.

Our existing terminal checking code should be taught about $LINES and 
$COLUMNS, and should check them as a fallback for when the ioctl returns 0.  
That's a small enough amount of bloat to be acceptable in exchange for the 
functionality, it's basically atoi(getenv("LINES"))...

I added it (svn 16167).  Dunno if it works, have to set up a test environment 
that hasn't got a controlling terminal but has $LINES and $COLUMNS set...

Anyway, I can teach bbsh that when it's launched interactive, do the probing 
thing if standard querying doesn't work to determine terminal size.  That'll 
set $LINES and $COLUMNS for its child programs, and svn 16167 should 
theoretically be able to take it from there...

Rob
-- 
Never bet against the cheap plastic solution.


More information about the busybox mailing list