Skip to content

fix(tui): show the session list spinner for background shell commands - #51811

Closed
kernel-oops wants to merge 1 commit into
anomalyco:devfrom
kernel-oops:fix/session-list-shell-spinner
Closed

kernel-oops wants to merge 1 commit into
anomalyco:devfrom
kernel-oops:fix/session-list-shell-spinner

Conversation

@kernel-oops

Copy link
Copy Markdown
Contributor

Issue for this PR

Fixes #51810

Type of change

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

What does this PR do?

The session list's spinner checked session.status for the session and its family, so background shell commands never counted. The prompt footer already counts them (via data.shell), which is why a session can show 1 shell inside while looking idle in the list.

This adds a small sessionActive helper in util/session.ts that treats a session as active when it or any session in its family has a running turn or a background shell (data.shell.listBySession), and uses it for the list's gutter spinner. Shells are looked up across the locations the TUI has loaded, the same data the footer uses.

How did you verify your code works?

  • New tests in test/util/session.test.ts for the helper: running turn, running subagent, background shell, and a background shell started by a subagent (and one belonging to an unrelated session, which must not count).
  • bun test test/util/session.test.ts test/cli/tui/dialog-session-list.test.tsx test/feature-plugins/prompt-footer.test.tsx and bun run typecheck in packages/tui; Prettier check on the changed files.

Screenshots / recordings

The change is the presence of the existing list spinner for a session running only a background shell; no new UI.

Checklist

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01RG8UhiogA1Ho2eZRx8tn2y

The session list spinner covered a running turn and running subagents, but not
background shell commands, so a session running a long command in the
background (a full test suite, for instance) looked idle in the list while its
own footer showed "1 shell". The list now uses a sessionActive helper that also
counts background shells belonging to the session or its subagents.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RG8UhiogA1Ho2eZRx8tn2y
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

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

@kernel-oops

Copy link
Copy Markdown
Contributor Author

Closing to stay within the open pull request limit so I can submit a fix for #59615. The underlying issue #51810 still stands; happy to reopen this if it's wanted.

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.

TUI session list shows no activity spinner for background shell commands

1 participant