Skip to content

Conversation

@cstamas
Copy link
Contributor

@cstamas cstamas commented Jan 26, 2025

This commit fixes a bug where pump threads were not being properly closed in
terminal implementations. The issue occurred in both ExternalTerminal and
PosixPtyTerminal classes where the pause() method was directly setting the
paused flag without properly handling thread interruption.

Changes:

  • Modified pause() in ExternalTerminal and PosixPtyTerminal to call pause(false)
    instead of directly setting the paused flag
  • Updated pause(boolean wait) to only join threads when wait=true
  • Added proper exception handling for InterruptedException

This fix prevents potential thread leaks where pump threads might continue
running in the background after they're no longer needed, ensuring proper
resource cleanup.

@cstamas cstamas marked this pull request as draft January 26, 2025 20:28
@gnodet gnodet changed the title bug: pump threads not closed fix: ensure proper cleanup of pump threads in terminal implementations Apr 26, 2025
@gnodet gnodet marked this pull request as ready for review April 26, 2025 04:47
@gnodet gnodet merged commit 04f472b into jline:master Apr 26, 2025
5 checks passed
@gnodet gnodet added the bug label Apr 30, 2025
@gnodet gnodet added this to the 3.29.1 milestone Apr 30, 2025
@gnodet gnodet changed the title fix: ensure proper cleanup of pump threads in terminal implementations Ensure proper cleanup of pump threads in terminal implementations Apr 30, 2025
@cstamas cstamas deleted the pump-close branch May 15, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants