Back to Signal Feed
CodeTracked since May 19, 2026

Fix pager stdin FD leak on command start failure

In `maybeStartPager` (`internal/cmd/session.go`), the error path now closes the pager stdin pipe when `cmd.Start()` fails, preventing descriptor leakage on each failed pager launch.

charmbracelet/crushmaybeStartPagercmd.Startos.StdinPipe

What Happened

  • In `maybeStartPager` (`internal/cmd/session.go`), the error path now closes the pager stdin pipe when `cmd.Start()` fails, preventing descriptor leakage on each failed pager launch.
  • In `maybeStartPager` (`internal/cmd/session.go`), the error path now closes the pager stdin pipe when `cmd.Start()` fails, preventing descriptor leakage on each failed pager launch.
  • 1 evidence item attached for review.

What is Different

Before

Scattered source updates, isolated context, and manual follow-up across multiple feeds.

Now

Adds explicit cleanup in the `cmd.Start()` failure branch so the pipe created for pager stdin is closed immediately when pager startup fails (e.g., missing/non-executable `PAGER`), aligning failure-path resource handling with the normal success-path teardown.

Why Track This

Why It Matters

Operators running Crush as a long-lived service (such as MCP integrations) will avoid accumulating leaked file descriptors when pager startup fails, reducing the chance of `too many open files` failures during repeated `session show/list/diff` calls; track long-running sessions for any remaining FD growth in other launcher error branches. The fix specifically closes the OS pipe immediately on `cmd.Start()` errors, so failure cases no longer diverge from the happy-path cleanup behavior.

Impact

Operators running Crush as a long-lived service (such as MCP integrations) will avoid accumulating leaked file descriptors when pager startup fails, reducing the chance of `too many open files` failures during repeated `session show/list/diff` calls; track long-running sessions for any remaining FD growth in other launcher error branches. The fix specifically closes the OS pipe immediately on `cmd.Start()` errors, so failure cases no longer diverge from the happy-path cleanup behavior.

What To Watch Next

  • Watch whether charmbracelet/crush becomes a repeated pattern.
  • Track follow-up changes around Model Context Protocol.
  • Compare future signals against this evidence trail.
  • Re-check risk flags: fd_leak_in_long_lived_sessions, invalid_pager_config_retries.
Open Topic TimelineOpen Technical EventOpen Original Sourcefd_leak_in_long_lived_sessions / invalid_pager_config_retries / other_exec_start_error_paths_unverified

Supporting Evidence