Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!uakari.primate.wisc.edu!dogie.macc.wisc.edu!uwvax!umn-d-ub!umn-cs!brsmith From: brsmith@umn-cs.CS.UMN.EDU (Brian R. Smith) Newsgroups: comp.windows.x Subject: Re: how does xterm tell vi the window size Keywords: xterm vi Message-ID: <16231@umn-cs.CS.UMN.EDU> Date: 11 Oct 89 21:20:04 GMT References: <253@zeek.UUCP> <1227@virtech.UUCP> <286@enuxha.eas.asu.edu> <1233@virtech.UUCP> <1055@acorn.co.uk> Organization: University of Minnesota, Minneapolis Lines: 41 john@acorn.co.uk (John Bowler) writes: >The mechanism used by vi, and most other termcap (and terminfo?) based >programs, to find out how big the window is simply doesn't work >adequately on systems with variable sized windows (eg xterm windows). >On BSD systems (including Sun OS) what vi does goes something along the >lines of:- I beg to differ; I've just tried it, and the checking order is: vi on SunOs 3.5: 1) The environment variable TERMCAP, if it contains the termcap entry and not the name of the file it's in. 2) The new tty driver (on BSD, who uses anything else?) 3) /etc/termcap (using TERM) (if the tty driver reports (0,0)) vi on SunOS 4.0.3, Dynix 3.0.12: 1) new tty driver (only tty driver on SunOS 4.0.3) 2) TERMCAP 3) /etc/termcap (using TERM) >The problem is that the standard ``xterm'' termcap (or terminfo) entry >has co#80:li#24 entries (ie 80 columns, 24 lines). These entries are >picked up at stage (1) above, and vi does not see if the terminal >driver has any opinion. The ``resize'' program does not really fix the >problem - it allows you (the user) to generate new TERMCAP entries and >put them into your environment, but these still become incorrect >whenever the window size is changed. Our (Acorn's) approach to this >problem is to distribute the following ``xterm'' /etc/termcap entries >(NOTE - this ONLY works on BSD systems with the new tty line driver, and >read the other comments below the entry before using it...) Looks like a kludge. The easiest fix is just to keep TERMCAP unset. That way, even on a SunOS 3.5 machine, it will work just fine. This also avoids your having to re-set TERMCAP if you change TERM, etc. Re-sizes pass just fine through rlogind in all of them, but SunOS 3.5 *and* 4.0.3 vi's ignore SIGWINCH for some reason. Looks like only Sequent got it right, and they don't even have a proprietary windowing system... Brian brsmith@umn-cs.cs.umn.edu