Skip to content

Commit 4800cf0

Browse files
committed
update some for ishell env
1 parent 4470b6c commit 4800cf0

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/AbstractApplication.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,23 @@ protected function startInteractiveShell(): void
426426
});
427427
}
428428

429+
$exitKeys = [
430+
'q' => 1,
431+
'quit' => 1,
432+
'exit' => 1,
433+
];
434+
429435
while (true) {
430436
$line = Interact::readln('<comment>CMD ></comment> ');
431-
if ($line === 'exit' || $line === 'quit') {
432-
break;
437+
if (strlen($line) < 5) {
438+
if (isset($exitKeys[$line])) {
439+
break;
440+
}
441+
442+
// "?" as show help
443+
if ($line === '?') {
444+
$line = 'help';
445+
}
433446
}
434447

435448
if ($hasPcntl) {
@@ -444,6 +457,7 @@ protected function startInteractiveShell(): void
444457

445458
// \vdump($in);
446459
$this->run(false);
460+
$out->println('');
447461
}
448462

449463
$out->colored("\nQuit. ByeBye!");

0 commit comments

Comments
 (0)