Restore ANSI colors for agent-launched terminals#4
Merged
Conversation
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changed
TERM=dumbhostNO_COLORonly for that host case, while preserving an explicit preference from interactive terminalsxterm-256colorand truecolor supportRoot cause
Unity inherited
TERM=dumbandNO_COLOR=1from the agent host. Unterm replacedTERMandCOLORTERM, butportable-ptyalso inheritedNO_COLOR, so Codex correctly suppressed SGR color sequences before they ever reached Unterm's parser and renderer.Impact
Codex and other color-aware terminal applications can render semantic colors, including red interruption/error text, when Unity was started from an agent or build environment. Users who intentionally set
NO_COLORfrom a normal interactive terminal keep that preference.Validation
cargo test -p unterm --lib --locked— 58 passed, 1 ignoredcargo clippy -p unterm --lib --bins --tests --lockedwith the workflow's documented legacy-lint allowances — passedrustfmt --edition 2021 --check unterm/src/pty.rs— passedNO_COLOR=1and 128 afterNO_COLORwas unsetThe repository-wide formatter and all-target example build still expose pre-existing unrelated debt (
dump_selectionreferences the removedunterm_get_pixelsAPI); this PR does not change those paths.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.