On 5/20/06, Sy Ali <sy1234 / gmail.com> wrote:
> On 5/20/06, Philip Hallstrom <ruby / philip.pjkh.com> wrote:
> > I can't help you, but you might not always have COLUMNS/ROWS.  I'm a tcsh
> > user and I don't think I've *ever* seen those variables set when doing a
> > printenv...
> >
> > so that's something else to consider...
>
> Yeah, I figured this.. it's almost certainly xterm that's generating
> these settings.. but I wanted to work on an in intermediate solution
> so that I can think about the logic associated with this knowledge.
> Later I'd want to do something far more universal.
>
> I can dream up a screen dimension-detection function, by leveraging
> the ANSI features which I've got access to.  (By printing certain
> characters and then moving the cursor in certain ways and detecting
> for them)
>
> I want to avoid yet another dependancy.. maybe I should just have a
> configuration file (constants for now) so the user can set this
> information for the script.

Also remember that screen dimensions can change while the program is
running. I think ncurses has ways of dealing with this. It may be
better to bit the bullet on this one and use other people's work, it
can get quite tricky.

If you do consider Ncurses, bear in mind that it's not exactly the
same between Windows and Linux.

Les