The Process component defines methods like setTty(), setPty(), isPtySupported(), etc. We should explain what do those method mean.
This issue shows how a problem could be solved just by using setTty() method: https://github.com/symfony/symfony/issues/17010
Here is another example where using ->setTty(true) magically solved all the problems: https://github.com/symfony/symfony/issues/15626
Also note it has some painful drawbacks:
@ogizanagi let's call it "the TTY lottery" then. It can solve all your problems ... or ruin everything!
Interesting. I think the lack of understanding of shells/ttys is the main problem here.
I was also looking for an option to get colored output from an started Process.
Agreed that a basic TTY understanding is the ideal solution here but it's difficult to learn/know everything in this complicated world. Maybe a short #explainlikeimfive description can be added?
That said, the guide[1] does not include the string tty at all, or at least I assume that's what this doc issue is referring to. I might come up with something but it'd be vague as my uneducated brain thinks ttyl whenever it comes across tty ;)
Most helpful comment
@ogizanagi let's call it "the TTY lottery" then. It can solve all your problems ... or ruin everything!