Capturing CTRL+D EOF to exit the shell
* Capturing CTRL+D (EOF) to exit the shell * replace junit to assertj * fix hang on testing
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.shell.jline;
|
||||
|
||||
import org.jline.reader.EndOfFileException;
|
||||
import org.jline.reader.LineReader;
|
||||
import org.jline.reader.UserInterruptException;
|
||||
import org.jline.utils.AttributedString;
|
||||
@@ -101,6 +102,9 @@ public class InteractiveShellRunner implements ShellRunner {
|
||||
return Input.EMPTY;
|
||||
}
|
||||
}
|
||||
catch (EndOfFileException e) {
|
||||
throw new ExitRequest(1);
|
||||
}
|
||||
return new ParsedLineInput(lineReader.getParsedLine());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user