Skip to content

Process component output with colour #17010

@samsamm777

Description

@samsamm777

When running the ls -lsa command in a shell, it will produce output with colour. However when running the same command in a symfony process the output doesn't have colour. Is there any way I can do this?

$process = new Process('ls -lsa');
$process->start();

// ... do other things

$process->wait(function ($type, $buffer) {
    if (Process::ERR === $type) {
        echo 'ERR > '.$buffer;
    } else {
        echo 'OUT > '.$buffer;
    }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions