stuff chars

David Elliott dce at quacky.UUCP
Tue Dec 9 14:29:18 AEST 1986


In article <775 at wjvax.wjvax.UUCP> brett at wjvax.UUCP (Brett Galloway) writes:
>In article <104 at quacky.UUCP> dce at quacky.UUCP (David Elliott) writes:
>>
>>I have never found a way to change the handling of signals such that
>>input is not flushed.
>
>I think that you can use ^Y to embed a stop character in a typed-ahead
>input stream.
>-- 

I stand corrected, mainly because I didn't state my case correctly.
What I meant was that I know of no way to have a program generate
a signal that affects a process without flushing the input. (I've
been proven wrong...read on.)

In the case of ^Z and ^Y, the difference is that ^Z is handled when it
comes into the tty input stream, and ^Y is handled when it is to be handed
on to the command. In the case of a command that sends itself a signal,
a simple experiment shows that input is not flushed:

	myprompt% csh
	% sleep 100
	suspend     <- typeahead
	pwd         <- typeahead
	%myprompt% /right/here

If we take a look at vi, we see that delayed suspend (^Y) is
turned off, and (oh my gosh!) the suspend character is mapped to ^Z
(try doing a 'stty susp ^T', run vi, and do a :map; try not to throw
up).

I think that one way to solve the original problem would be to have
some buffer that vi stuffs into the tty driver at suspend time. Any
ideas on how to pursue this (not that it's partiularly useful, but
it might be fun).

			David



More information about the Comp.unix.wizards mailing list