I'm a programmer specialising in performant and scalable systems using PHP and Ruby and cooking


Published:
On PHP | Symfony2

Symfony2, clearing terminal

Recently I was creating an interactive console command and I wanted to make it clearer for the user.

To do this I needed to be able to clear the terminal window to make the actions stand out. It's actually really simple:

$output->write(chr(27).chr(91).'H'.chr(27).chr(91).'J');