Subject: Re: bin/10116: vi somewhat easily confused by suspension
To: None <gnats-bugs@gnats.netbsd.org, tech-userlevel@netbsd.org>
From: ITOH Yasufumi <itohy@netbsd.org>
List: tech-userlevel
Date: 05/29/2000 15:17:32
J.D.Coleman@newcastle.ac.uk writes:
> >                                                              Is it worth
> > importing nvi-1.79 (wasn't there mention of this a while back?)?  If not,

doc/3RDPARTY says "Bostic says not to update from 1.66."
I don't know why.

> > the bits dealing with SA_ALTERNATE need to be back-ported in order to fix
> > this (see also the comment in cl_attr() (cl/cl_funcs.c:91) in 1.79.
> 
> Hmm, no comments.  I've added the alternate screen handling from 1.79 to our
> vi.  Patches appended.

Seems OK....
(Sorry, I haven't tested it yet.)

>                         One thing that I noticed is that running a command
> from vi does not switch out of "keypad enable" mode.  For example, type :
> 
>   :!cat
> 
> and watch what the cursor keys generate.  Does this matter?

I don't think it so matters, but keypad is automatically disabled
by endwin(), isn't it?

Anyway, we should re-enable the keypad on entering visual mode.
If the child process wants to use keypad keys, it takes care by itself,
and probably it will leave the terminal in "keypad disabled" state.

	:!vi

>                                                              Also, perhaps it
> would be nice to get the shell prompt back on a new line instead of :
> 
>   Press any key to continue [: to enter more ex commands]: aire:njdc bash$ 
> 
> when vi exits and I didn't press <return> at the prompt.

Yeah. :-)
-- 
ITOH, Yasufumi