Terminals created via TerminalBuilder.builder().system(false).build() throw a NullPointerException when close() is called.
This prevents proper resource cleanup in tests and any code using non-system terminals. Currently, tests in the prompt module work around this by not closing their terminals, which leaks resources.
See prompt/src/test/java/org/jline/prompt/IntegrationTest.java for an example of the workaround.
Found during review of #1794.
Claude Code on behalf of Guillaume Nodet
Terminals created via
TerminalBuilder.builder().system(false).build()throw aNullPointerExceptionwhenclose()is called.This prevents proper resource cleanup in tests and any code using non-system terminals. Currently, tests in the
promptmodule work around this by not closing their terminals, which leaks resources.See
prompt/src/test/java/org/jline/prompt/IntegrationTest.javafor an example of the workaround.Found during review of #1794.
Claude Code on behalf of Guillaume Nodet