Skip to content

fix(tui): remove shells from their location - #39885

Merged
kitlangton merged 2 commits into
v2from
cross-location-shell
Jul 31, 2026
Merged

fix(tui): remove shells from their location#39885
kitlangton merged 2 commits into
v2from
cross-location-shell

Conversation

@kitlangton

@kitlangton kitlangton commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

What

Remove a running shell through the location that owns it, even when the TUI is currently displaying another project location.

This follows up on #39691, which made session shells visible across loaded locations but left shell removal scoped to the current location.

Before / After

Before

  1. Start a shell in location A.
  2. Open the same session while the TUI's current location is B.
  3. The Shell composer tab finds the shell by session and displays it.
  4. Killing the shell sends its ID to location B, where that shell does not exist, so the process keeps running.

After

  1. Shell synchronization and live events retain each shell's owning LocationRef.
  2. The Shell composer tab sends removal to the selected shell's location.
  3. The process is removed regardless of the TUI's current location.

How

  • packages/tui/src/context/data.tsx stores shell location provenance for API results and shell.created events.
  • packages/tui/src/routes/session/composer/shell-tab.tsx removes the selected shell through that stored location.
  • packages/tui/test/cli/tui/data.test.tsx loads one session's shells from two locations, triggers the composer kill command, and verifies the DELETE query uses the owning directory and workspace. It also covers live-event provenance.

Scope

This does not change shell creation, synchronization ownership, or the server shell API.

Testing

  • cd packages/tui && bun run test (575 passed, 5 skipped)
  • cd packages/tui && bun typecheck
  • Pre-push hook: bun turbo typecheck --concurrency=3 (33 tasks passed)

@kitlangton
kitlangton merged commit d07d9ae into v2 Jul 31, 2026
9 checks passed
@kitlangton
kitlangton deleted the cross-location-shell branch July 31, 2026 14:46
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.

1 participant