Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site nsc-pdc.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!reed!nsc-pdc!mark
From: mark@nsc-pdc.UUCP (Mark Nudelman)
Newsgroups: net.sources.bugs
Subject: Re: Re: bug in less
Message-ID: <508@nsc-pdc.UUCP>
Date: Tue, 29-Oct-85 00:59:55 EST
Article-I.D.: nsc-pdc.508
Posted: Tue Oct 29 00:59:55 1985
Date-Received: Wed, 30-Oct-85 06:40:24 EST
References: <210@speech2.cs.cmu.edu>
Organization: NSC Portland Development Center, Portland Oregon
Lines: 49

> What he meant to say was:
> 
>    When the v option (go into editor) is invoked, one can edit the file with
> no problems; but when one exits the editor less gets confused. Less puts the
> prompt line on the first line of the screen and beeps at any command. 

Two different bugs are being discussed here.  The first is that a
subcommand invoked from less (like vi from "v" or a shell command
from "!") cannot be suspended with ^Z.  (This applies only to BSD
versions.)  My fix is to replace the lsystem() function in signal.c
with the code at the end of this message.

The other bug is the one mentioned in the quote above: less gets
confused after returning from vi.  I can't produce this behavior,
so if anyone has seen this bug, I'd like to know what system it 
was running on (BSD, System V, etc) and what type of terminal 
you were using.  Also, if possible, details as to exactly what
keystrokes produce what kinds of misbehavior.


Mark Nudelman			ihnp4!nsc!nsc-pdc!mark
National Semiconductor		tektronix!reed!nsc-pdc!mark


---------- start of replacement for lsystem() function  --------------
lsystem(cmd)
	char *cmd;
{
	lower_left();
	clear_eol();
	puts("!");
	puts(cmd);
	puts("\n");

	deinit();
	flush();
	raw_mode(0);

	SIGNAL(SIGINT, SIG_DFL);
#ifdef SIGTSTP
	SIGNAL(SIGTSTP, SIG_DFL);
#endif
	system(cmd);

	init_signals();
	raw_mode(1);
	init();
}
---------- end of replacement for lsystem() function  --------------