From ba0f04e1c37a1a29ae5303e4c8f1ac24e29ae97e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 25 Apr 2017 10:00:52 +0200 Subject: [PATCH] Documented the new QuestionHelper::disableStty() method --- components/console/helpers/questionhelper.rst | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/components/console/helpers/questionhelper.rst b/components/console/helpers/questionhelper.rst index 33ac48a3601..a4e9ca3a670 100644 --- a/components/console/helpers/questionhelper.rst +++ b/components/console/helpers/questionhelper.rst @@ -205,6 +205,28 @@ convenient for passwords:: like in the example above. In this case, a ``RuntimeException`` would be thrown. +.. note:: + + The ``stty`` command is used to get and set properties of the command line + (such as getting the number of rows and columns or hiding the input text). + On Windows systems, this ``stty`` command may generate gibberish output and + mangle the input text. If that's your case, disable it with this command:: + + use Symfony\Component\Console\Question\ChoiceQuestion; + + // ... + public function execute(InputInterface $input, OutputInterface $output) + { + // ... + $helper = $this->getHelper('question'); + $helper->disableStty(); + + // ... + } + + .. versionadded:: 3.3 + The ``QuestionHelper::disableStty()`` method was introduced in Symfony 3.3. + Normalizing the Answer ----------------------