Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

shell trap handling

0 views
Skip to first unread message

Will Renkel

unread,
Dec 24, 2009, 4:36:46 PM12/24/09
to

I have a need under CYGWIN to have a break(ctrl-C) handler identical to vanilla UNIX.
Currently under CYGWIN, the break sequence does NOT seem to clear type ahead commands.
Hence a sequence such as sleep 15; hhh;jjj ... BREAK
terminates the sleep but then executes hhh and jjj.
I can program a trap handler to clear the type ahead using 'tcflush(0, TCIFLUSH)'.
But then I don't get correct handling of such things as unbalanced quotes on the input line.
Hence input of -> 'abc <- will not terminate with a BREAK until I enter a single quote.
So what I am looking for is a way to use the tcflush with the standard system capability.
Any ideas for a solution?
I asked this question under cygwin group
but am adding it here as well.
Like, how do I use the system handling AND add to it in the trap handler?

--
---------------------------------------------------------------
Will Renkel
Wheaton, Ill.

---------------------------------------------------------------

Will Renkel

unread,
Dec 24, 2009, 4:34:31 PM12/24/09
to
0 new messages