Skip to content

fix(tui): handle SIGINT and SIGTERM for graceful shutdown#24659

Open
rektide wants to merge 1 commit intoanomalyco:devfrom
rektide:term
Open

fix(tui): handle SIGINT and SIGTERM for graceful shutdown#24659
rektide wants to merge 1 commit intoanomalyco:devfrom
rektide:term

Conversation

@rektide
Copy link
Copy Markdown
Contributor

@rektide rektide commented Apr 27, 2026

Issue for this PR

Closes #24658

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Handles SIGTERM and SIGINT the same way SIGHUP is handled, having the UI trigger a full cleanup.

How did you verify your code works?

Ran it locally.

Screenshots / recordings

  Session   opencode-sample-session
  Continue  opencode -s ses_22f9e3302ffe63raHGWJ04o92l

(Successful exit!)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected. 👍

@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found several related PRs that address signal handling and graceful shutdown:

Potentially Related PRs:

  1. #12718 - fix(cli): handle SIGHUP to prevent orphaned processes on terminal close

  2. #24297 - fix(opencode): resolve heap unlimited + orphan processes on Linux

    • Related to process cleanup and signal handling
  3. #20006 - fix: clean up orphaned processes and LSP state on shutdown

    • Related to shutdown cleanup logic
  4. #9866 - fix(serve): add signal handlers for graceful shutdown on Windows

    • Similar signal handler implementation for graceful shutdown

These PRs address similar concerns around signal handling (SIGTERM, SIGINT, SIGHUP) and graceful shutdown. The most relevant appears to be #12718 which specifically handles SIGHUP for process cleanup - exactly the mechanism PR #24659 aims to extend to SIGTERM and SIGINT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SIGTERM hangs, does not output anything

1 participant