Skip to content

Commit fbfd51b

Browse files
committed
minor #9406 Documented the new isTtySupported() method (javiereguiluz)
This PR was squashed before being merged into the master branch (closes #9406). Discussion ---------- Documented the new isTtySupported() method This fixes #9013. Commits ------- 43e131b Documented the new isTtySupported() method
2 parents a294625 + 43e131b commit fbfd51b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

components/process.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,25 @@ absolute path of the executable PHP binary available on your server::
422422
$phpBinaryPath = $phpBinaryFinder->find();
423423
// $phpBinaryPath = '/usr/local/bin/php' (the result will be different on your computer)
424424

425+
Checking for TTY Support
426+
------------------------
427+
428+
Another utility provided by this component is a method called
429+
:method:`Symfony\\Component\\Process\\Process::isTtySupported` which returns
430+
whether `TTY`_ is supported on the current operating system::
431+
432+
use Symfony\Component\Process\Process;
433+
434+
$process = (new Process())->setTty(Process::isTtySupported());
435+
436+
.. versionadded:: 4.1
437+
The ``isTtySupported()`` method was introduced in Symfony 4.1.
438+
425439
.. _`Symfony Issue#5759`: https://github.com/symfony/symfony/issues/5759
426440
.. _`PHP Bug#39992`: https://bugs.php.net/bug.php?id=39992
427441
.. _`exec`: https://en.wikipedia.org/wiki/Exec_(operating_system)
428442
.. _`pid`: https://en.wikipedia.org/wiki/Process_identifier
429443
.. _`PHP Documentation`: https://php.net/manual/en/pcntl.constants.php
430444
.. _Packagist: https://packagist.org/packages/symfony/process
431445
.. _`PHP streams`: http://www.php.net/manual/en/book.stream.php
446+
.. _`TTY`: https://en.wikipedia.org/wiki/Tty_(unix)

0 commit comments

Comments
 (0)