Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
color on linux terminal
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-01-13 (21:38)
From: Philippe Wang <lists@p...>
Subject: Re: [Caml-list] color on linux terminal

On 13 janv. 07, at 21:56, Goulagman wrote:

> It's because, for Ocaml,   the escape sequence \0xx matches the  
> ASCII character xx in decimal, not in octal.
> print_string "\027[31m blabla" works fine

Well, what you said is true, still it's not meant to be explained  
like this ! (well I guess and hope so)

The backslash in a character or string sequence introduces a decimal  
number between 0 and 255 with *exactly* 3 digits.

You can also write special characters in hexadecimal :

"\xFF"  = "\255"