8000 minor #7837 Documented the new QuestionHelper::disableStty() method (… · symfony/symfony-docs@1dd8b5d · GitHub
[go: up one dir, main page]

Skip to content

Commit 1dd8b5d

Browse files
committed
minor #7837 Documented the new QuestionHelper::disableStty() method (javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Documented the new QuestionHelper::disableStty() method This fixes #7825. Commits ------- ba0f04e Documented the new QuestionHelper::disableStty() method
2 parents a65811e + ba0f04e commit 1dd8b5d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

components/console/helpers/questionhelper.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,28 @@ convenient for passwords::
205205
like in the example above. In this case, a ``RuntimeException``
206206
would be thrown.
207207

208+
.. note::
209+
210+
The ``stty`` command is used to get and set properties of the command line
211+
(such as getting the number of rows and columns or hiding the input text).
212+
On Windows systems, this ``stty`` command may generate gibberish output and
213+
mangle the input text. If that's your case, disable it with this command::
214+
215+
use Symfony\Component\Console\Question\ChoiceQuestion;
216+
217+
// ...
218+
public function execute(InputInterface $input, OutputInterface $output)
219+
{
220+
// ...
221+
$helper = $this->getHelper('question');
222+
$helper->disableStty();
223+
224+
// ...
225+
}
226+
227+
.. versionadded:: 3.3
228+
The ``QuestionHelper::disableStty()`` method was introduced in Symfony 3.3.
229+
208230
Normalizing the Answer
209231
----------------------
210232

0 commit comments

Comments
 (0)
0