diff --git a/extend/ba/Terminal.php b/extend/ba/Terminal.php index 05ab1c7d..c965796e 100644 --- a/extend/ba/Terminal.php +++ b/extend/ba/Terminal.php @@ -220,6 +220,7 @@ class Terminal if (preg_match('/\r\n|\r|\n/', $newOutput)) { $this->output($newOutput); $this->outputContent = $contents; + $this->checkOutput(); } } @@ -287,6 +288,17 @@ class Terminal } } + + /** + * 检查输出 + */ + public function checkOutput(): void + { + if (str_contains($this->outputContent, '(Y/n)')) { + $this->execError('An interactive command has been detected, and you can manually execute the command to confirm the situation.', true); + } + } + /** * 输出状态标记 * @param string $flag