diff --git a/source/orelang/Interpreter.d b/source/orelang/Interpreter.d index 65af905..15ca7cd 100644 --- a/source/orelang/Interpreter.d +++ b/source/orelang/Interpreter.d @@ -71,7 +71,8 @@ class Interpreter { while (true) { string input = readln.chomp; - if (input == "exit" || input == "(exit)") { + if (stdin.eof() || input == "exit" || input == "(exit)") { // stdin.eof() for Ctrl-D + writeln("bye!"); // print newline, so do not mess up the screen break; } diff --git a/source/orelang/operator/SystemOperator.d b/source/orelang/operator/SystemOperator.d index ae8a8dc..06cd48f 100644 --- a/source/orelang/operator/SystemOperator.d +++ b/source/orelang/operator/SystemOperator.d @@ -21,7 +21,7 @@ class SystemOperator : IOperator { auto pid = spawnProcess(args_strs);//execute(args_strs.join(" ")); return new Value(wait(pid)); - } catch { + } catch (Throwable) { return new Value(-1); } }