1
0
Fork 0

Merge pull request #3094 from TomK/patch-1

read and discard zero chars to initialise STDIN
pull/3137/head
Jordi Boggiano 2014-07-19 19:48:48 +02:00
commit 32a9eebcd6
1 changed files with 1 additions and 1 deletions

View File

@ -177,7 +177,7 @@ class ConsoleIO extends BaseIO
// use bash if it's present
if ($finder->find('bash') && $finder->find('stty')) {
$this->write($question, false);
$value = rtrim(shell_exec('bash -c "stty -echo; read -r mypassword; stty echo; echo $mypassword"'));
$value = rtrim(shell_exec('bash -c "stty -echo; read -n0 discard; read -r mypassword; stty echo; echo $mypassword"'));
$this->write('');
return $value;