Skip to content

Documented the new isTtySupported() method #9406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions components/process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,25 @@ absolute path of the executable PHP binary available on your server::
$phpBinaryPath = $phpBinaryFinder->find();
// $phpBinaryPath = '/usr/local/bin/php' (the result will be different on your computer)

Checking for TTY Support
------------------------

Another utility provided by this component is a method called
:method:`Symfony\\Component\\Process\\Process::isTtySupported` which returns
whether `TTY`_ is supported on the current operating system::

use Symfony\Component\Process\Process;

$process = (new Process())->setTty(Process::isTtySupported());

.. versionadded:: 4.1
The ``isTtySupported()`` method was introduced in Symfony 4.1.

.. _`Symfony Issue#5759`: https://github.com/symfony/symfony/issues/5759
.. _`PHP Bug#39992`: https://bugs.php.net/bug.php?id=39992
.. _`exec`: https://en.wikipedia.org/wiki/Exec_(operating_system)
.. _`pid`: https://en.wikipedia.org/wiki/Process_identifier
.. _`PHP Documentation`: https://php.net/manual/en/pcntl.constants.php
.. _Packagist: https://packagist.org/packages/symfony/process
.. _`PHP streams`: http://www.php.net/manual/en/book.stream.php
.. _`TTY`: https://en.wikipedia.org/wiki/Tty_(unix)