X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org From: Barry Kelly To: cygwin AT cygwin DOT com Subject: Re: java vs c, escape sequences Date: Sat, 13 Sep 2008 12:33:10 +0100 Message-ID: <139nc45vrjhi6pdpb4333ijm7sj74alkuh@4ax.com> References: <19469048 DOT post AT talk DOT nabble DOT com> In-Reply-To: <19469048.post@talk.nabble.com> X-Mailer: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m8DBY6Sl011738 rick271828 wrote: > Can anybody please explain why the c code: > printf("%c[H%c[J",27,27); clears my cygwin console as expected, but the > Java code: > > System.out.print("\033[2J\033[H"); > > displays a back arrow instead on interpreting the escape character? It's because you are not running the program with stdout attached to a terminal or terminal emulator. Probably, you are running in a console window. Cygwin can emulate a terminal in a console window for programs that do all I/O through it, but for third-party applications, like Sun java, it cannot. Run the application in rxvt and it works as expected. -- Barry -- http://barrkel.blogspot.com/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/