Article View: comp.sys.xerox
Article #629A small utility for CHATting with UNIX
From: James Buchanan
Date: Tue, 29 Nov 1988 23:24
Date: Tue, 29 Nov 1988 23:24
41 lines
1842 bytes
1842 bytes
A little bit of ADVICE allows CHAT to tell UNIX about the size of
its window in rows and columns every time one is opened or reshaped.
This allows you to use full screen UNIX utilities with any size of
CHAT window. It is especially nice when using vi or reading mail.
What you have to do is add the following advice:
(ADVISE 'CHAT.SCREENPARAMS 'AFTER 'FIRST '(CHAT.SETTY WINDOW))
Where CHAT.SETTY is defined as follows:
(DEFINEQ
( CHAT.SETTY
(LAMBDA (WINDOW)
( DECLARE (SPECVARS CHAT.SETTY))
(LET* ((STRING (WINDOWPROP WINDOW 'TITLE))
(HSTART (STRPOS "height = " STRING NIL NIL NIL T))
(HEND (SUB1 (STRPOS "," STRING HSTART)))
(WSTART (STRPOS "width = " STRING NIL NIL NIL T))
(WEND (NCHARS STRING))
(HEIGHT (MKATOM (SUBSTRING STRING HSTART HEND)))
(WIDTH (MKATOM (SUBSTRING STRING WSTART WEND))))
(TTY.PROCESS (WINDOWPROP WINDOW 'PROCESS))
(COND
( CHAT.SETTY (BKSYSBUF (CONCAT "stty rows "
HEIGHT " columns " WIDTH (CHARACTER 13)))))))))
Here the global variable CHAT.SETTY is just used to allow the user
to disable the advice if he/she wishes. Note that this advice
pumps the "stty ..." string to whatever process is listening on
the SUN, so it shouldn't be triggered if you are anywhere but in
the shell.
James Buchanan james@sparrms.UUCP
Spar Aerospace Ltd
1700 Ormont Drive (416) 745-9680
Weston, Ontario, CANADA M9L 2W7
Technical Details
Message-ID:
<224@sparrmsuucp>Path:
arc1-ca.pugleaf.net!utzoo!yunexus!ists!sparrms!jamesShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!yunexus!ists!sparrms!james From: james@sparrmsuucp (James Buchanan) Newsgroups: comp.sys.xerox Subject: A small utility for CHATting with UNIX Keywords: CHAT stty Message-ID: <224@sparrmsuucp> Date: 29 Nov 88 23:24:04 GMT Article-I.D.: sparrmsu.224 Lines: 41