🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
2 messages
2 total messages Started by William Kucharski Tue, 10 Sep 1991 17:25
Problem with TI/TE sequences in rn 44
#578
Author: William Kucharski
Date: Tue, 10 Sep 1991 17:25
70 lines
3136 bytes
I sent this to Stan Barber, but I also wanted to ping the net on this:

> I've noticed one problem with rn 44, and that's that it uses the termlib init
> and end variables (TI and TE) if they exist.  Unfortunately, with terminal
> descriptions that have alternate screens (e.g. xterm), rn can confuse things
> quite a bit by doing this.  For example, when using rn and vi(1) as your
> editor, on a Solbourne or other SunOS machine, the following will happen:
> 
>     1) Start rn -- the screen will flip to the "alternate" screen.
>     2) Perform an action which calls an editor (e.g. vi(1)).  vi will
>        output the "TI" sequence, also setting "alternate" screen mode.
>        But when you exit vi, it emits a "TE" sequence, switching back
>        to the "normal" screen.
>     3) Now rn starts using the normal screen, with the unfortunate result
>        that the "send/edit/abort" prompt is placed in the middle of the
>        screen of text that was present when rn first switched to the
>        "alternate" screen.
> 
> I don't know if this is technically correct behavior or whether this happens
> because termlib wasn't designed to deal with the problem of two applications
> fighting for control of a sscreen/window.
> 
> For now, I've modified term.c:
> 
> *** term.c.orig	Tue Sep 10 11:09:44 1991
> --- term.c	Tue Sep 10 11:11:22 1991
> ***************
> *** 1119,1125 ****
>   void
>   termlib_init()
>   {
> ! #ifdef HAVETERMLIB
>   	if (TI && *TI)
>   		tputs (TI,1,putchr);
>   #endif
> --- 1119,1125 ----
>   void
>   termlib_init()
>   {
> ! #if defined HAVETERMLIB && !defined sun
>   	if (TI && *TI)
>   		tputs (TI,1,putchr);
>   #endif
> ***************
> *** 1128,1134 ****
>   void
>   termlib_reset()
>   {
> ! #ifdef HAVETERMLIB
>   	if (TE && *TE)
>   		tputs (TE,1,putchr);
>   #endif
> --- 1128,1134 ----
>   void
>   termlib_reset()
>   {
> ! #if defined HAVETERMLIB && !defined sun
>   	if (TE && *TE)
>   		tputs (TE,1,putchr);
>   #endif
> 
> But perhaps there should be some type of config variable to control this...

Anyone have any other proposals to solve this problem?
-- 
| William Kucharski, Solbourne Computer, Inc.     | Opinions expressed above
| Internet: kucharsk@solbourne.com   Ham: N0OKQ   | are MINE alone, not those
| uucp:	...!{boulder,sun,uunet}!stan!kucharsk     | of Solbourne...
| Snail Mail: 1900 Pike Road, Longmont, CO  80501 | "It's Night 9 With D2 Dave!"
Re: Problem with TI/TE sequences in rn 44
#601
Author: Vincent Archer
Date: Fri, 13 Sep 1991 21:04
42 lines
2772 bytes
In article <1991Sep10.172550.12050@solbourne.com> kucharsk@solbourne.com (William Kucharski) writes:
> I've noticed one problem with rn 44, and that's that it uses the termlib init
> and end variables (TI and TE) if they exist.  Unfortunately, with terminal
> descriptions that have alternate screens (e.g. xterm), rn can confuse things
> quite a bit by doing this.  For example, when using rn and vi(1) as your
> editor, on a Solbourne or other SunOS machine, the following will happen:
> 
>     1) Start rn -- the screen will flip to the "alternate" screen.
>     2) Perform an action which calls an editor (e.g. vi(1)).  vi will
>        output the "TI" sequence, also setting "alternate" screen mode.
>        But when you exit vi, it emits a "TE" sequence, switching back
>        to the "normal" screen.
>     3) Now rn starts using the normal screen, with the unfortunate result
>        that the "send/edit/abort" prompt is placed in the middle of the
>        screen of text that was present when rn first switched to the
>        "alternate" screen.

Note:	This behaviour appear only when using a cmdtool (which I prompty
discarded after being hit three times by "/ file system full" and an
infinite loop of "Can't insert [Continue]" buttons) or xterm. Never with a
shelltool...

Anyway, your suggested hack (!defined sun) is not the "proper" way of
doing it. The proper behaviour for ANY program that uses cursor motions,
and therefore TI/TE is:
	1> When entering your fullscreen mode, send TI
	2> When exiting your fullscreen mode, send TE
	3> When giving away control to another program, send TE
	4> When getting back control from the program in 3, send TI

That's what vi(1) does when you use ":!command". But then, vi is broken,
because it outputs sequences at the wrong places. Try:
:!cat /dev/null
[Hit return to continue]
:!cat /dev/null
(without hitting [return])

Verrrry nice... (oops, away from newsreaders. Stuff for alt.sys.sun :-)
-- 
	Vincent Archer			Email:	archer@frmug.fr.mugnet.org
					Or:	archer@evry.cnes.fr
Anything good in life is either illegal, immoral, or fattening.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads