stuff chars

David Elliott dce at quacky.UUCP
Thu Dec 4 15:34:05 AEST 1986


In article <2270 at sdcsvax.UCSD.EDU> hutch at sdcsvax.UUCP (Jim Hutchison) writes:
>...
>
>I suggest sending "\n:stop\n" to stop vi, this should circumvent that
>flushing problem you get with just sending ^Z to vi and letting it deal
>with the intterupt.  This also gets around the problem of having the
>stop character set to something other than ^Z (heaven forbid! :-)

If you look at the code for ex, you will notice that ^Z and :stop are
handled in the same way. That is, the onsusp() routine is called, which
just resets the SIGTSTP handler to SIG_DFL, and sends a SIGTSTP to the
current process. You can't stop a process in BSD Unix without a signal.

In other words, the only difference between ^Z and :stop is what you
type. The reason to have :stop is so that you can typeahead long
before you enter vi. For example, let's say you are executing some
command to create a file that you then need to edit. You might execute
the original command in the foreground, type in a couple of more commands,
type in the vi command, and some vi commands (such as a search for a
pattern). At this point, you realize that you will need to read a
manual page. If you type ^Z, you stop now and lose the input you typed
ahead. If you type :stop, you will enter vi and stop. Loss of typeahead
can really be a pain (this makes the Apollo Domain/IX version of vi,
and some of the nicer shell line editors not worth using).

I have never found a way to change the handling of signals such that
input is not flushed.

			David
			decwrl!mips!dce



More information about the Comp.unix.wizards mailing list