iPXE discussion forum
Change iPXEs shell default background color (black to blue) - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: Change iPXEs shell default background color (black to blue) (/showthread.php?tid=6794)



Change iPXEs shell default background color (black to blue) - Torgeir - 2013-01-15 11:23

Hi!

Does anyone know if/where I can change iPXEs shell default background color?

I want it to be blue. That way, when using iPXEs menu and login. Its all gonna be blue Wink

For getting user input I use iPXEs shell, and the background color goes back and forth (blue/black)...

Torgeir


RE: Change iPXEs shell default background color (black to blue) - robinsmidsrod - 2013-01-15 13:52

I think you can use a common ANSI escape code to set the background color. Once you have the byte sequence, it should be just a matter of echoing it to the terminal. See the documentation for "echo" and "set" for details. I'm not entirely sure, but you might need to do this every time you exit out of one of the menus (TUI). Please report back if you have success with this approach.


RE: Change iPXEs shell default background color (black to blue) - Torgeir - 2013-01-19 11:43

Hi!

Since I use php, I will just post my php code...
(problably dont need the "set" code inside the loop Wink )
PHP Code:
<?php

echo "#!ipxe \n";
header "Content-type: text/plain" );

echo 
"prompt press any key for blue screen \n";
echo 
bluescreen();
echo 
"prompt screen is now blue (press any key to reload \n";
echo 
"chain -ar http://192.168.2.29/first.stage.php \n";

function 
bluescreen()
{
    echo 
'set esc:hex 1b' "\n";
    echo 
'set blue ${esc:string}[44m' "\n";
    echo 
'echo ${blue}' "\n";
    for (
$i=0$i 25$i++) { 
        echo 
"echo \n";
    }
}
?>

Torgeir