Reputation: 3371
I have a very simple project using Symfony components, and displaying messages in console.
It declares a standard ConsoleOutput
like this:
$this->output = new ConsoleOutput();
$formatter = $this->output->getFormatter();
$formatter->setStyle('blink', new OutputFormatterStyle(null, null, array('blink')));
$formatter->setStyle('bold', new OutputFormatterStyle(null, null, array('bold')));
When I try to display messages with "blink"
$this->output->writeln(sprintf('%s<blink>...</blink>', $message));
It does not "blink", it displays the text with standard format. First I thought it was my own terminal issue, but it's the 2nd computer I check and it does not blink at all.
I tested to add a bold+blink format, like this
OutputFormatterStyle(null, null, ['bold', 'blink']);
And the result is a bold text, not blink.
If you want to access the complete code, it's here: https://github.com/akeneo/nelson/blob/master/src/Akeneo/System/AbstractConsoleLogger.php#L29
Upvotes: 2
Views: 304
Reputation: 6796
Most probably your terminal doesn't support blinking text. You can test it running in bash:
echo -e "Normal \e[33mYellow\e[0m \e[1mBold\e[0m \e[5mBlink\e[0m"
My Putty shows correctly yellow and bold text but doesn't blink.
Most terminals don't support it:
http://misc.flogisoft.com/bash/tip_colors_and_formatting#terminals_compatibility
Upvotes: 2