Skip to content

Commit

Permalink
update some for ishell env
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Jan 24, 2021
1 parent 4470b6c commit 4800cf0
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/AbstractApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,23 @@ protected function startInteractiveShell(): void
});
}

$exitKeys = [
'q' => 1,
'quit' => 1,
'exit' => 1,
];

while (true) {
$line = Interact::readln('<comment>CMD ></comment> ');
if ($line === 'exit' || $line === 'quit') {
break;
if (strlen($line) < 5) {
if (isset($exitKeys[$line])) {
break;
}

// "?" as show help
if ($line === '?') {
$line = 'help';
}
}

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

// \vdump($in);
$this->run(false);
$out->println('');
}

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

0 comments on commit 4800cf0

Please sign in to comment.