zed/crates/sidebar
Hugh L 104ccf4bb6
agent_ui: Fix agent terminal close behavior with keyboard shortcuts (#58217)
Self-Review Checklist:

- [ *] I've reviewed my own diff for quality, security, and reliability
- [ *] Unsafe blocks (if any) have justifying comments
- [ *] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ *] Tests cover the new/changed behavior
- [ *] Performance impact has been considered and is acceptable

What:
  - Closing the active terminal from the sidebar activated the remaining
terminal.But closing a terminal with Ctrl-D could leave the agent panel
in an
uninitialized `Zed Agent` state instead of activating the remaining
terminal.
<img width="804" height="380" alt="image"
src="https://github.com/user-attachments/assets/eaa67c6e-7f3d-4a1c-b72d-9cabfaab872b"
/>

How:
  - Terminal exits emit `TerminalCloseRequested`.
- The sidebar handles that request through the same close path used by
the
  sidebar close button.
- Neighbor activation, draft fallback, metadata cleanup, and
linked-worktree/
  archive handling stay centralized in the sidebar close flow.

Added test coverage for closing an active terminal via terminal exit and
  activating the remaining terminal neighbor.

Testing:
  - `cargo check -p agent_ui`
  - `cargo check -p sidebar`
  - Manually verified Ctrl-D terminal close behavior with multiple agent
  threads/terminals

Release Notes:

- Fixed closing an agent terminal with Ctrl-D leaving the agent panel
  uninitialized instead of activating the remaining terminal
2026-07-24 12:52:03 +00:00
..
src agent_ui: Fix agent terminal close behavior with keyboard shortcuts (#58217) 2026-07-24 12:52:03 +00:00
Cargo.toml sidebar: Add submenu to create a worktree (#59341) 2026-06-16 22:33:12 +00:00
LICENSE-GPL Move sidebar back out of the panel (#51723) 2026-03-17 03:48:20 +00:00