Skip to content

Commit f061e73

Browse files
committed
shell - handling EOF in shell.
Fixes #200
1 parent 3db7d18 commit f061e73

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

restx-shell/src/main/java/restx/shell/RestxShell.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ public void start() throws IOException {
100100
boolean exit = false;
101101
while (!exit) {
102102
String line = consoleReader.readLine();
103-
exit = exec(line);
103+
if(line == null) { // line will be null when EOF, eg ctrl+c
104+
exit = true;
105+
} else {
106+
exit = exec(line);
107+
}
104108
}
105109

106110
terminate();

0 commit comments

Comments
 (0)