Skip to content

Terminals created with system(false) NPE when closed #1806

@gnodet

Description

@gnodet

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions