Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Date: Tue, 13 Mar 2012 01:05:21 +0100 Organization: albasani.net Lines: 57 Message-ID: References: <4f5d18ef$0$291$14726298@news.sunsite.dk> <4f5d239d$0$293$14726298@news.sunsite.dk> <4f5e8d1f$0$290$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net n5bUYxXTsru8cWW5FP8et6RcknpcjxfriSKkldum5X7DV7vl3UIoyC8wlnJBPZwAZpbsoGwPB+CyPE6zFrNAjis/XssBRWrOHZm+WwFq/SRNNMApesHikd3SADTCLs1N NNTP-Posting-Date: Tue, 13 Mar 2012 00:05:22 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="niRFIgdvVA0kmPPKeVSnUz952yTrgEroMuxwYfEiQAhQQzq7tqCaVYSxLKW5IOPSvjbbPBb7emSk25H5y6Q7/kQ6hf9HO7CSZ7MHiwUwmkcJaIoObrjCF5lCHrJgWu6f"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Firefox/10.0.2 SeaMonkey/2.7.2 In-Reply-To: <4f5e8d1f$0$290$14726298@news.sunsite.dk> Cancel-Lock: sha1:+O8OYVdftfmdfey7NIoIqBjbkcU= Xref: csiph.com comp.lang.java.programmer:12939 Arne Vajhøj schrieb: > Lots of thing has changed over the years both in language, library > and JVM. > > They may not have made the changes you want, but you don't always get > what you want. One more guy who gets a masturbation organsm by saying: Its your fault. Doesn't help at all. As far as I can see the thread no substantial help has arrived so far. Neither some patch has been recommended, nor something else. Calling it an issue about more fine control over the terminal is ridiculus. I have checked the possibility already. I don't see that it is an ioctrl issue. Windows console has a flag PROCESS_INPUT, but it looks like that switching off this flag totally disables the Ctrl-C, it will then neither invoke the signal nor return an EOF. So there is no control possible, either the full package of signal and EOF is delivered or nothing. But MS spec says also how to detect it on the receiving side. So probably the some workaround would be a class: FileInputStreamFix Which would override the read() method of the FileInputStream. This I guess would be an easy patch I could apply, since I have access to the location in the application where the input stream is retrieved, and can give the application another object if necessary. I have already checked a couple of libs: - JLine: http://jline.sourceforge.net/ - Java Curses: http://sourceforge.net/projects/javacurses/ But it looks to me that they do much more than simply patching windows. They are often multi platform and not so small. So if somebody has already worked on such a class I would be interested. Bye P.S.: People who can't stand working on solutions, please simply refrain from the thread.