diff --git a/spring-shell-core/src/main/java/org/springframework/shell/Shell.java b/spring-shell-core/src/main/java/org/springframework/shell/Shell.java index bbeb3e2a..564849bd 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/Shell.java +++ b/spring-shell-core/src/main/java/org/springframework/shell/Shell.java @@ -119,12 +119,15 @@ public class Shell implements CommandRegistry { */ public void run(InputProvider inputProvider) throws IOException { Object result = null; - while (!(result instanceof ExitRequest)) { + while (!(result instanceof ExitRequest)) { // Handles ExitRequest thrown from Quit command Input input; try { input = inputProvider.readInput(); } catch (Exception e) { + if (e instanceof ExitRequest) { // Handles ExitRequest thrown from hitting CTRL-C + break; + } resultHandler.handleResult(e); continue; } diff --git a/spring-shell-samples/pom.xml b/spring-shell-samples/pom.xml index 08d74ba5..d5ab4a9b 100644 --- a/spring-shell-samples/pom.xml +++ b/spring-shell-samples/pom.xml @@ -9,7 +9,7 @@ org.springframework.shell spring-shell-parent - 2.0.0.BUILD-SNAPSHOT + 2.0.1.BUILD-SNAPSHOT Examples of using Spring Shell 2