mirror of
https://github.com/openai/codex.git
synced 2026-05-04 13:21:54 +03:00
Merge branch 'agentydragon-task/08-set-shell-title' into agentydragon
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
|
||||
## Status
|
||||
|
||||
**General Status**: Not started
|
||||
**Summary**: Not started; missing Implementation details (How it was implemented and How it works).
|
||||
**General Status**: Complete
|
||||
**Summary**: All acceptance criteria have been implemented and verified. Shell title functionality is fully operational.
|
||||
|
||||
## Goal
|
||||
|
||||
@@ -23,12 +23,22 @@ Allow the CLI to update the terminal title bar to reflect the current session st
|
||||
- Ensure title updates work across Linux, macOS, and Windows terminals via ANSI escape sequences.
|
||||
|
||||
## Implementation
|
||||
**Note**: Final implementation applied; see detailed design and behavior below.
|
||||
|
||||
**How it was implemented**
|
||||
*(Not implemented yet)*
|
||||
- Extended the session protocol schema (`SessionConfiguredEvent`) to include an optional `title` field, enabling persistence of the shell title across sessions.
|
||||
- Added a new slash command `/set-title <text>` in the TUI (`slash_command.rs` and `app.rs`) that emits a dedicated `Op::SetTitle` operation carrying the user-provided title.
|
||||
- Updated the core agent loop (`codex-core`) to store the latest title in session metadata and emit a `SessionUpdatedTitleEvent` (alongside `SessionConfiguredEvent`) when the title changes.
|
||||
- In both the interactive TUI (`tui/src/chatwidget.rs`) and non-interactive exec client (`exec/src/event_processor.rs`), hooked into session events (startup, title updates, task begin/complete, thinking/idle states, approval prompts) to send ANSI escape sequences (`\x1b]0;<title>\x07`) to the terminal before rendering, ensuring real-time title updates.
|
||||
- Selected consistent Unicode status symbols (▶ for executing, ⏳ for thinking, 🟢 for idle, ❗ for awaiting approval) and prepended them to the title text.
|
||||
- On startup (SessionConfiguredEvent), restored the last persisted title if present, falling back to a configurable default (e.g. “Codex CLI”).
|
||||
|
||||
**How it works**
|
||||
*(Not implemented yet)*
|
||||
- **Slash command**: when the user types `/set-title My Title`, the composer dispatches `Op::SetTitle("My Title")` instead of a regular user-input message.
|
||||
- **Core storage**: the core session handler persists the new title in memory and in the session JSON file under the `title` key.
|
||||
- **Event broadcast**: the core emits a `SessionUpdatedTitleEvent` (or extends `SessionConfiguredEvent` on resume) carrying the new title.
|
||||
- **ANSI update**: the TUI and exec clients listen for title-related events and immediately print the ANSI escape sequence (`\x1b]0;{symbol} {title}\x07`) to stdout before drawing UI or logs. Terminals on Linux, macOS, and Windows (supported via ANSI) update their window/tab title accordingly.
|
||||
- **Dynamic status**: on key lifecycle events (task start → ▶, reasoning → ⏳ animation, task complete → 🟢, approval overlays → ❗), clients format and emit the corresponding status symbol and the active title to visually reflect the current session state in the shell title.
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user