From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 947D6BC0B for ; Sat, 13 Jan 2007 21:57:17 +0100 (CET) Received: from chokecherry.srv.cs.cmu.edu (CHOKECHERRY.SRV.CS.CMU.EDU [128.2.185.41]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0DKvF5C006223 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 13 Jan 2007 21:57:17 +0100 Received: from stratocaster.home (c-24-3-144-139.hsd1.mn.comcast.net [24.3.144.139]) (authenticated bits=0) by chokecherry.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id l0DKvEnK018749 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Sat, 13 Jan 2007 15:57:14 -0500 (EST) Received: from ecc by stratocaster.home with local (Exim 4.63) (envelope-from ) id 1H5pvY-0006GV-Ld; Sat, 13 Jan 2007 15:56:36 -0500 Date: Sat, 13 Jan 2007 15:56:36 -0500 To: caml-list@yquem.inria.fr, caml-list@inria.fr Subject: Re: [Caml-list] color on linux terminal Message-ID: <20070113205636.GB24042@localhost> Mail-Followup-To: caml-list@yquem.inria.fr, caml-list@inria.fr References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) From: Eric Cooper X-Miltered: at discorde with ID 45A947AB.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; markus:01 ocaml:01 blabla:01 ocaml:01 escapes:01 blabla:01 033:98 033:98 pet:98 027:98 unix:01 wrote:01 caml-list:01 output:02 color:97 On Sat, Jan 13, 2007 at 08:29:16PM +0000, Markus Weihs wrote: > to get coloured output on a linux terminal, you can do something like > > echo -e "\033[31m This is now red" > > How can I do this with OCaml? The following doesn't work > > print_string "\033[31m blabla" This is my biggest "pet peeve" about OCaml. It uses *decimal* escapes for characters, not octal like everywhere else in the UNIX and C-influenced universe. So you want print_string "\027[31m blabla" -- Eric Cooper e c c @ c m u . e d u