Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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"

;-)