changing unix-pc's idea of window size

Norman Yarvin yarvin-norman at cs.yale.edu
Fri Aug 3 11:54:25 AEST 1990


In article <232 at hico2.UUCP> kak at hico2.UUCP (Kris A. Kugel) writes:
>Well, I found a small font to load into those undersized 3b1 windows.
>When I use the vi editor, however, only a limited section of the window
>window is used.   How can I change the size that the window thinks it is?

There are two different systems programs use for determining window size:
terminfo (System 5) and termcap (BSD).  The Unix PC has both; some programs
that come with the system (e.g. more) use termcap and other programs use
terminfo.

Both of these systems use the environment variable TERM to determine the
terminal type; each terminal type has a terminal description, stored in
/etc/termcap (for termcap) or in /usr/lib/terminfo/*/* (one file per
terminal) for terminfo.  The terminal description specifies the screen size.
Thus it is possible to change your window size by making one terminal
description for each size you want.  This is a pain.

Both termcap and terminfo have ways to override the size in the terminal
description.  For terminfo, you set the environment variables LINES and
COLUMNS.  For termcap, you set the environment variable TERMCAP.  TERMCAP
can be set to a name of a file, in which case termcap looks in that file
rather than in /etc/termcap for terminal descriptions; TERMCAP can also be
set to a terminal description.

So to resize your window, set your environment up with:

LINES=24			# or whatever
COLUMNS=80
TERMCAP=vs|xterm|vs100|xterm terminal emulator (X window system):
:cr=^M:do=^J:nl=^J:bl=^G:le=^H:ho=\E[H:cl=\E[H\E[2J:
:bs:am:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:ce=\E[K:cd=\E[J:so=\E[7m:se=\E[m:
us=\E[4m:ue=\E[m:md=\E[1m:mr=\E[7m:me=\E[m:ku=\EOA:kd=\EOB:kr=
\EOC:kl=\EOD:kb=^H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:ta=^I:pt:sf=\n:sr=\E
M:al=\E[L:dl=\E[M:ic=\E[@:dc=\E[P:MT:ks=\E[?1h\E=:ke=\E[?1l\E>
:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:rs=\E[r\E<\E[m\E[2J\E[
H\E[?7h\E[?1;3;4;6l:xn:AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP:
:ti=\E7\E[?47h:te=\E[2J\E[?47l\E8:hs:ts=\E[?E\E[?%i%dT:fs=\E[?F:es
:ds=\E[?E:li#24:co#80:		# replace this with a unix pc termcap entry
				# and take out the newlines
export LINES COLUMNS TERMCAP

I am aware of two programs that get the current window size and set up these
variables; one is called "sz" or "rsz" or something, and the other is my
"wind" program, a small command interpreter which opens windows and runs
processes in them.

--
Norman Yarvin					yarvin-norman at cs.yale.edu



More information about the Comp.sys.att mailing list