Suppose I have a PHP script that prints time.
echo time() . "\r\n";
Executing this script several times in CLI will look like this:
curiosity:bin gajus$ php -r 'echo time() . "\r\n";'
1434453316
curiosity:bin gajus$ php -r 'echo time() . "\r\n";'
1434453318
curiosity:bin gajus$ php -r 'echo time() . "\r\n";'
1434453319
curiosity:bin gajus$
I want my PHP script to print printf '\e\]50;ClearScrollback\a'
sequence that would clear iTerm2 scrollback. I have tried variations of php -r 'echo "\e\]50;ClearScrollback\a" .time() . "\r\n";'
but that just spits the string to the CLI output:
curiosity:bin gajus$ php -r 'echo "\e\]50;ClearScrollback\a" .time() . "\r\n";'
]50;ClearScrollback\a1434453543
curiosity:bin gajus$
Is there a way to trigger CLI ClearScrollback
from within PHP script?