[comp.sys.mac] uw window resizing for BSD 4.2 kludge

earleh@dartvax.UUCP (04/17/87)

This is those uw users who have to work with 4.2 BSD or programs on
4.3 BSD that don't know about window resizing.  "big" is for 7-point font,
enlarged window, "small" is for default, "rows" and "columns" have the 
obvious effect.  Put it in your ".cshrc".  It won't work for those who have
an enlarged screen with more than 100 rows or columns, but I haven't heard of
such a beast yet.

alias rows 'setenv TERMCAP "`setenv|sed -n -e s,li#..,li#\!*, -e s,TERMCAP=,,p`"'
alias columns 'setenv TERMCAP "`setenv|sed -n -e s,co#..,co#\!*, -e s,TERMCAP=,,p`"'
alias big 'rows 36;columns 90'
alias small 'rows 24;columns 80'
alias tiny 'rows 5;columns 20'  #(just kidding)

jdb@mordor.s1.gov (John Bruner) (04/20/87)

Keywords:


>This is those uw users who have to work with 4.2 BSD or programs on
>4.3 BSD that don't know about window resizing... It won't work for those
>who have an enlarged screen with more than 100 rows or columns, but I
>haven't heard of such a beast yet.

If you're using the UW server on a machine that doesn't handle window
resizing (i.e. 4.2BSD without something like Sun's TIOCSSIZE ioctl),
then you won't be able to change the actual size of the window on
the Mac (even if you select "actual size").  The reason is that the
Mac will only allow the actual window size to change if the server
has requested window size change notification (by sending a WOC_DO
command for option WOTTY_SIZE).  If you want to override this
behavior you can unconditionally define RPTWINSZ in "uw_tty.c"
(approximately at line 68) as "(1<<WOTTY_SIZE)".

The maximum height and width for a UW window is 94 rows and 94 columns.
The limit is imposed by the encoding function used for mouse event
reporting ("send to host").  Due to a bug in v3.4, UW won't allow you
to grow a window larger than 93 rows or columns.  (You can grow the
window more on a Radius if you hold down the Option key, but UW still
won't use more than 94 rows or columns.)
-- 
  John Bruner (S-1 Project, Lawrence Livermore National Laboratory)
  jdb@mordor.s1.gov	...!seismo!mordor!jdb		(415) 423-4848

earleh@dartvax.UUCP (Earle R. Horton) (04/24/87)

In article <7280@mordor.s1.gov>, jdb@mordor.s1.gov (John Bruner) writes:
> >This is those uw users who have to work with 4.2 BSD or programs on
> >4.3 BSD that don't know about window resizing... It won't work for those
> >who have an enlarged screen with more than 100 rows or columns, but I
> >haven't heard of such a beast yet.
> 
> If you're using the UW server on a machine that doesn't handle window
> resizing (i.e. 4.2BSD without something like Sun's TIOCSSIZE ioctl),
> then you won't be able to change the actual size of the window on
> the Mac (even if you select "actual size").  

I beg to differ, John.  If you set the window settings in uw to 
"change view size" (I think that's right, I don't have my Mac here.)
and then use my setenv/sed kludge, you change the TERMCAP entry in
your environment to reflect the new rows/columns you desire.  Then 
when you run vi, emacs, more, whatever, you can get the display
to have the number of rows and columns you have specified.  I do this
all the time.  I use the 7-point font option, and make the window as
big as my Mac screen allows, approximately 36 rows by 93 columns. 
Then I type in "big" (aliases included below) and get a 36x90 display
that works fine with JOVE on an IBM RT running 4.2.  I guess it's a
matter of definition, I am under the impression that if I can successfully
display a larger window, then I have changed the "actual" size, although
perhaps not the "'actual'" size.  Anyway, this works, but I think 
"change view size" is the appropriate setting to use.  My Mac is not
here at the moment, so I can't say for sure.  Anyway, if you try this 
and it doesn't work, change the tty setting on the Mac to the other
one and it will work.

     These aliases are also helpful if you have 4.3 and you want to run
a program that doesn't understand tty resizing, which is the case when
management won't pay for upgrades, programmers are overworked, or 
whatever.  Here they are for those who may have missed the earlier 
posting.

alias rows 'setenv TERMCAP "`setenv|sed -n -e s,li#..,li#\!*, -e s,TERMCAP=,,p`"'
alias columns 'setenv TERMCAP "`setenv|sed -n -e s,co#..,co#\!*, -e s,TERMCAP=,,p`"'
alias big 'rows 36;columns 90'
alias small 'rows 24;columns 80'

Hope this clarifies things.

Earle

earleh@dartvax.UUCP (Earle R. Horton) (04/24/87)

In article <6060@dartvax.UUCP>, earleh@dartvax.UUCP (Earle R. Horton) writes:
> In article <7280@mordor.s1.gov>, jdb@mordor.s1.gov (John Bruner) writes:
...
> > If you're using the UW server on a machine that doesn't handle window
> > resizing (i.e. 4.2BSD without something like Sun's TIOCSSIZE ioctl),
> > then you won't be able to change the actual size of the window on
> > the Mac (even if you select "actual size").  
> 
> I beg to differ, John.  If you set the window settings in uw to 
> "change view size" (I think that's right, I don't have my Mac here.)

Sorry, I just got back to my Mac and it is, indeed "Change Actual Size."
In other words, if you use the aliases I posted earlier to change the
line and column number entries in your environment TERMCAP variable, and
your uw windows are set for "Change Actual Size" then programs on the host
assume the new size, and the Mac goes along with it, even under 4.2BSD.
As far as I know, this trick should work with any program that looks up 
the terminal size under the TERMCAP entry.  Of course, resizing the window
while the program is running is out of the question, after all, it's still
a 4.2 host...