> doing things sometimes.  Your way works, though it leaves LINES and ROWS
> set to the old values.  No problem of course.  Is there some elegant test
> I can do to see if I am connect to a ttyx or a ttypx I wonder?  Then I
> could automate the thing.

You could do something like:

if (expr $TTY : "/dev/ttyp[0-9]\+" >/dev/null)
then SETTINGS-FOR-XTERM
fi

If your shell does not set the TTY variable on its own, you'll need to put 
something like:

TTY=`/usr/bin/tty`

before it.

> Would you mind explaining the
>  eval `resize`
> line for me?  It appears to be unnecessary!

/usr/bin/X11/resize is a program that probes the terminal for its size, then 
outputs something like:

COLUMNS=85;
LINES=36;
export COLUMNS LINES;

or using setenv for csh-syntax shells.

The eval `` construct causes the shell to evaluate these commands, thereby 
setting the COLUMNS and LINES variables in your environment.

This, in theory, will appropriately size your terminal for whatever window size 
you're using.  Unfortunately, many braindead Windows telnet programs with poor 
VT100 emulation return the screen geometry in reverse or worse, requiring a 
manual override.

If you're always using the same window size it may be easier to just use 
specified values as was your original intent.

Reply via email to