X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
From: Barry Kelly <bkelly.ie@gmail.com>
To: cygwin@cygwin.com
Subject: Re: java vs c, escape sequences
Date: Sat, 13 Sep 2008 12:33:10 +0100
Message-ID: <139nc45vrjhi6pdpb4333ijm7sj74alkuh@4ax.com>
References: <19469048.post@talk.nabble.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@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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/


