Repository navigation
fix(tui): use BEL for terminal title updates - #18261
Merged
Merged
Conversation
fcoury-oai
approved these changes
Apr 17, 2026
fcoury-oai
left a comment
Contributor
There was a problem hiding this comment.
Replicated the issue by unselecting all items on the title picker and was able to also confirm the fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #18160.
iTerm2 can append the current foreground process to tab titles, and Codex's terminal-title updates were causing that decoration to appear as
(codex")with a stray trailing quote. Codex was writing OSC 0 title sequences terminated with ST (ESC \). Some terminal title integrations appear to accept that title update but still expose the ST terminator in their own process/title decoration.Changes
codex-rs/tui/src/terminal_title.rsto terminate OSC 0 title updates with BEL instead of ST.Compatibility
This should be low risk: the title payload and update timing are unchanged, and BEL is the form already emitted by
crossterm::terminal::SetTitlein the crossterm version used by this repository. BEL is also the widely supported xterm-family title terminator used by common terminals and multiplexers. The main theoretical risk would be a very old or unusual terminal that accepted only ST and not BEL for OSC title termination, but that is unlikely compared with the observed iTerm2 issue.Verification
cargo test -p codex-tui terminal_titlecargo test -p codex-tui