Fix serial tty setup, include matches in prompt event
This commit is contained in:
@@ -62,13 +62,13 @@ class LineBufferedDuplexStream implements ReadableStreamInterface, WritableStrea
|
||||
|
||||
// Check if the buffer matches the prompt pattern
|
||||
if ($this->promptPattern !== null) {
|
||||
if (preg_match($this->promptPattern, $this->buffer)) {
|
||||
if (preg_match($this->promptPattern, $this->buffer, $matches)) {
|
||||
$this->buffer = preg_replace($this->promptPattern, '', $this->buffer);
|
||||
if ($this->bufferOutput) {
|
||||
$this->emit(self::EVT_OUTPUT, [$this->output]);
|
||||
$this->output = [];
|
||||
}
|
||||
$this->emit(self::EVT_PROMPT, []);
|
||||
$this->emit(self::EVT_PROMPT, [ $matches ]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user