Created
November 4, 2015 08:51
-
-
Save jaytaph/9a331f4ff6a116e7dc9e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Helper/QuestionHelper.php b/Helper/QuestionHelper.php | |
index 3707ffe..781eff3 100644 | |
--- a/Helper/QuestionHelper.php | |
+++ b/Helper/QuestionHelper.php | |
@@ -30,6 +30,7 @@ class QuestionHelper extends Helper | |
private $inputStream; | |
private static $shell; | |
private static $stty; | |
+ private $readlinePrompt; | |
/** | |
* Asks a question to the user. | |
@@ -172,7 +173,11 @@ class QuestionHelper extends Helper | |
$message = $question->getPrompt(); | |
} | |
- $output->write($message); | |
+ if ($this->inputStream == STDIN && function_exists('readline')) { | |
+ $this->readlinePrompt = $message; | |
+ } else { | |
+ $output->write($message); | |
+ } | |
} | |
/** | |
@@ -438,7 +443,7 @@ class QuestionHelper extends Helper | |
private function readFromInput($stream) | |
{ | |
if (STDIN === $stream && function_exists('readline')) { | |
- $ret = readline(); | |
+ $ret = readline($this->readlinePrompt); | |
} else { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment