1
0
Fork 0

fix return code for interactive mode

This commit is contained in:
jsteemann 2016-11-18 18:31:17 +01:00
parent d6a063e28d
commit 347b840d5e
1 changed files with 3 additions and 2 deletions

View File

@ -331,7 +331,8 @@ int V8ShellFeature::runShell(std::vector<std::string> const& positionals) {
client = nullptr;
}
bool lastEmpty = false;
bool const isBatch = isatty(STDIN_FILENO) == 0;
bool lastEmpty = isBatch;
while (true) {
_console->setPromptError(promptError);
@ -350,7 +351,7 @@ int V8ShellFeature::runShell(std::vector<std::string> const& positionals) {
lastEmpty = true;
continue;
}
lastEmpty = false;
lastEmpty = isBatch;
_console->log(prompt._plain + input + "\n");