in reply to Re: change/detect term screen background color
in thread change/detect term screen background color

Your first script didn't work for me, it only changes the bg of the text.

also, there is an error in your code:
system("echo -e"\e[1;32;40m black"); system("echo -e "\e[0m");

should be something like:

system("echo -e '\e[1;32;40m black'"); system("echo -e '\e[0m'");

Replies are listed 'Best First'.
Re^3: change/detect term screen background color
by Allasso (Monk) on Feb 19, 2011 at 20:02 UTC

    okay, it works if I add this after the color change:

    system("clear");

      here is an example that works:

      change screen color for a script, then change it back when script exits:

      #!/usr/bin/perl use strict; use warnings; # change bgcolor and text system("echo -e '\e[44m'"); system("clear"); print "interactive script with blue background...\n\n"; print "press return to exit script:\n\n"; <STDIN>; # revert to original color system("echo -e '\e[0m'"); system("clear");
      Anyway, thanks for getting my brain going.