Mysterious transformation of tset(1) output on Suns
Greg_Earle
earle at smeagol.UUCP
Thu Oct 10 15:35:12 AEST 1985
I have a question for the Sun gurus. When inside the window system,
executing "tset -QS" directly from the shell gives output that
'knows' about the size (lines, columns) of the current window:
e.g.
% tset -QS; echo
sun Mu|sun:li#50:co#76:cl=^L:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:am:bs:km:mi:ms:
(etc.)
rs=\E[s: %
(line broken up for readability). Note the entries for li and co.
But lo and behold; if you should try to do anything with this output, like
put it between `` for use with eval, or even through a pipe or a redirected
output, the output suddenly mysteriously changes back to a 'normal' sun
termcap entry:
% tset -QS | cat
sun Mu|sun:li#34:co#80:cl=^L:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:am:bs:km:mi:ms:
( etc.)
rs=\E[s: %
Or:
% tset -QS > /tmp/foo
% cat /tmp/foo
sun Mu|sun:li#34:co#80:cl=^L:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:am:bs:km:mi:ms:
( etc. )
rs=\E[s : %
How/Why is this happening? more(1) seems to know about the length of the tty
subwindow; you get everything from the top of the window down to the last
line before more stops. Does it get it directly from the window subsystem?
One reason I ask is that it seems like it could be a wonderful feature;
you could put a series of statements in your .cshrc file (like the
example given in the man page for tset with option -S) so each program
that used $TERMCAP would know about the window limits if it wanted
(I was thinking of modifying vnews(1) to do this, instead of the fixed
# of lines you get).
For a minute, I thought the old "can't set your parent's env from yerself"
but that can't be it; you can muck all your other environment variables to
your hearts content inside the (non-login) shell windows.
Thanks in advance.
Greg Earle
...!{{decvax,ucbvax}!sdcsvax,hplabs,allegra,trwrb}!sdcrdcf!smeagol!lorien!earle
...!{ihnp4,decvax,ucbvax}!sun!tsunami!smeagol!lorien!earle
More information about the Comp.unix.wizards
mailing list