Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/07/2010, 14:52
Avatar de neodani
neodani
 
Fecha de Ingreso: marzo-2007
Mensajes: 1.811
Antigüedad: 17 años, 1 mes
Puntos: 20
Mostar colores por la terminal en windows

Buenas,

Sabéis por qué en linux me funcionan los colores por el terminal y en windows (consola cmd) no, ¿sabéis por qué?

El código que uso es el siguiente. No se puede mostrar colores en el terminal de windows? :S

http://perl.active-venture.com/lib/Term/ANSIColor.html

Código PERL:
Ver original
  1. use Term::ANSIColor;
  2.     print color 'bold blue';
  3.     print "This text is bold blue.\n";
  4.     print color 'reset';
  5.     print "This text is normal.\n";
  6.     print colored ("Yellow on magenta.\n", 'yellow on_magenta');
  7.     print "This text is normal.\n";
  8.     print colored ['yellow on_magenta'], "Yellow on magenta.\n";
  9.  
  10.     use Term::ANSIColor qw(uncolor);
  11.     print uncolor '01;31', "\n";
  12.  
  13.     use Term::ANSIColor qw(:constants);
  14.     print BOLD, BLUE, "This text is in bold blue.\n", RESET;
  15.  
  16.     use Term::ANSIColor qw(:constants);
  17.     $Term::ANSIColor::AUTORESET = 1;
  18.     print BOLD BLUE "This text is in bold blue.\n";
  19.     print "This text is normal.\n";

Muchas gracias de antemano!