Extract ANSI escape sequence to a function

This commit is contained in:
salehhashemi1992
2023-10-13 20:16:46 +03:30
parent b126e8e6e4
commit 86c107ae5e
7 changed files with 19 additions and 8 deletions

View File

@ -9,7 +9,7 @@ $run = function (string $target, $decorated = false) {
$process->run();
return $decorated ? $process->getOutput() : preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $process->getOutput());
return $decorated ? $process->getOutput() : removeAnsiEscapeSequences($process->getOutput());
};
$snapshot = function ($name) {