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:
Yubi Lee
2022-06-08 02:20:52 +09:00
committed by GitHub
parent 3556352ab3
commit 38ce78434a
2 changed files with 136 additions and 0 deletions

View File

@@ -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());
}
}