Changed prompt management
This commit is contained in:
@ -6,6 +6,7 @@ use NoccyLabs\Shell\LineRead;
|
||||
|
||||
abstract class Shell
|
||||
{
|
||||
protected $prompt;
|
||||
|
||||
protected $promptStyle;
|
||||
|
||||
@ -76,6 +77,11 @@ abstract class Shell
|
||||
{
|
||||
}
|
||||
|
||||
public function setPrompt($prompt)
|
||||
{
|
||||
$this->prompt = $prompt;
|
||||
}
|
||||
|
||||
public function setPromptStyle($style)
|
||||
{
|
||||
$this->promptStyle = $style;
|
||||
@ -95,7 +101,7 @@ abstract class Shell
|
||||
$this->running = true;
|
||||
|
||||
do {
|
||||
$lineRead->setPrompt($this->getPrompt(), $this->promptStyle);
|
||||
$lineRead->setPrompt($this->prompt, $this->promptStyle);
|
||||
$buffer = $lineRead->update();
|
||||
if ($buffer == "\x03") {
|
||||
$this->stop();
|
||||
|
Reference in New Issue
Block a user