Codex CLI should set a persistent distinctive terminal title marker
What problem are you trying to solve?
When multiple AI coding CLIs are open at once, it is useful for each terminal window to have a distinctive, persistent identifier in the window title. Claude Code and Gemini CLI both put an identifying character in their terminal titles, which makes their windows easy to distinguish in window switchers and terminal tab lists.
Codex CLI currently does not appear to keep such an identifier in the terminal title during an interactive TUI session.
Observed behavior
Environment:
- Codex CLI:
codex-cli 0.130.0 - OS/shell: Linux, Bash
- Terminal supports OSC title sequences
A shell wrapper can briefly set the terminal title before launching Codex, for example:
printf '\033]2;✾ Codex\007'
command codex "$@"
But when Codex starts, the title is immediately overwritten, so the marker is not persistent. That makes the wrapper approach insufficient; this likely needs to be handled inside the Codex TUI itself.
Requested behavior
Please add a built-in persistent Codex terminal-title marker for interactive CLI sessions. For example, Codex could set the title to something beginning with U+273E:
✾ Codex
If Codex already has dynamic title content, the marker could be prepended instead of replacing that content, such as:
✾ Codex - /path/to/project
Details that would make this useful
- Keep the marker present throughout the interactive session, including after internal TUI title updates.
- Restore the previous terminal title on exit if Codex already manages terminal state cleanup.
- Gracefully no-op in environments that do not support OSC terminal title sequences.
- If a fixed marker is too opinionated, expose a config option for the title prefix/marker.
Why this matters
This is a small usability improvement, but it helps users quickly identify Codex sessions among other AI coding agents and regular terminals.
6 Comments
Thanks for the suggestion. In case you weren't aware, you can customize the title using the
/titleslash command. I'm curious whether any of the existing configuration options addresses your needs.I don't think it works for iterm2. I run the /title command
/title new titleand the tab remains the same. It would be nice to have this to keep some organization of what each tab is running.codex version: OpenAI Codex (v0.130.0)
iterm2 version: 3.6.10
<img width="806" height="217" alt="Image" src="https://github.com/user-attachments/assets/3f1cdbda-fe69-40c0-a9e5-9b975c9e387c" />
+1 for this. My main use case is VS Code integrated terminal tabs: when several Codex sessions are open, the tabs are hard to distinguish because Codex does not expose a useful OSC title.
/titlehelps only after a manual step. It would be much more useful if Codex automatically set a title on startup/resume, and updated it when a session title/topic is known, similar to how other agent CLIs make terminal tabs identifiable.This feature is blocking me from fully migrating over from Claude Code to Codex. I need the titles to automatically update based on what the session is about, otherwise it's almost impossible to figure out which tab corresponds to what work when running many sessions together, which is so common.
You should just summarize the first prompt into 7 or less words and make that the title of the session/terminal, or at least provide support for enabling this optionally.
@karolzdebel @Dtouch24680 @iconjack
The change I made to fix it was adding this to my .toml
now
/renameshould workI investigated this further on Codex CLI 0.146.0 using both VS Code’s integrated terminal and Ghostty.
With:
the activity spinner works, but an unnamed session displays its UUID instead of its automatic thread title. For the same session,
state_5.sqlitealready contains a useful automatictitleandpreview, whilenameisNULL.This appears to be a Codex TUI data mismatch rather than a terminal-emulator issue. On the
mainHEAD as of July 30, 2026 (355d2a8),StatusLineItem::ThreadTitlereads onlyChatWidget.thread_nameand otherwise falls back tothread_id. The TUI’sThreadSessionStatecarriesthread_namebut not the automatic title or preview. By comparison, the resume picker already uses a usefulthread_name → previewdisplay precedence.This is distinct from #17187 and #31124, which cover explicit names set through
/rename. The problem here is displaying the automatic title for ordinary sessions without requiring users to rename every thread manually.Would maintainers be open to an opt-in terminal-title item such as
thread-display-titleorthread-preview, with the following precedence?/renamenameA separate opt-in item would preserve the existing
thread-titlebehavior and avoid unexpectedly exposing prompt-derived text in terminal tabs, window titles, screenshots, or other OS-visible surfaces.If this approach aligns with the intended product semantics, would the team accept an external PR for it? I would be happy to implement the metadata plumbing and refresh behavior, along with focused TUI tests and snapshot coverage.