Path: utzoo!attcan!uunet!cs.utexas.edu!samsung!usc!apple!vsi1!octopus!sjsumcs!horstman From: horstman@sjsumcs.sjsu.edu (Cay Horstmann) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: Avoiding ^C Message-ID: <1990Jun30.203726.7480@sjsumcs.sjsu.edu> Date: 30 Jun 90 20:37:26 GMT References: <10688@spool.cs.wisc.edu> <577@dg.dg.com> Reply-To: horstman@sjsumcs.SJSU.EDU (Cay Horstmann) Organization: San Jose State University Lines: 29 In article <577@dg.dg.com> bruce@archive.rtp.dg.com (Bruce Kahn) writes: >In article <10688@spool.cs.wisc.edu>, so@brownie.cs.wisc.edu (Bryan So) writes: >|> I have tried to trap the Ctrl-Break and Ctrl-C interrupts by >|> "signal", "ctrlbrk" in Turbo C and installing my own 0x23 handler. >|> But there seems to be no way to prevent "^C" from printing out to >|> the screen. Can somebody explain a way to do it? Thanks. >|> >|> Bryan > > The only way that Ive found to prevent the annoying ^C from being displayed >is to NOT use the standard printf calls. I found that I had to issue direct >BIOS write calls and bypass DOS. The reason being (I was told a long long >time ago) that DOS allows you to insert your own INT23 handler but it stil >sets a 'break' flag internally and when it does any screen I/O it checks the >flag; if it is set it inserts a ^C into the buffer and clears the flag. > If you need more specifics I can dig out my code and tell you what exactly I >did (it may have been I issued INT21, AH=10H calls myself)... > > Bruce (bruce@archive.rtp.dg.com) I don't think this is true. Software which I wrote and which runs in graphics mode (with no calls to printf whatsoever) but homegrown put-the-pixels-to-the-screen routines for all I/O still shows the (expletive deleted) ^C, even though I (of course) remap the Ctrl-Brk|C handlers. I'd love to know what to do about this. Cay