Skip to content

Commit d3269ce

Browse files
committed
fix(attach): default COLORTERM=truecolor for 24-bit color in Docker exec
1 parent 7a0abeb commit d3269ce

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

internal/cmd/attach.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ func terminalEnv() []string {
115115
if os.Getenv("COLORFGBG") == "" {
116116
env = append(env, "COLORFGBG=15;0")
117117
}
118+
// Default COLORTERM so OpenCode renders with full 24-bit color palette.
119+
// Many terminals (iTerm2, Alacritty, kitty) set this, but Terminal.app and
120+
// Docker exec environments often don't.
121+
if os.Getenv("COLORTERM") == "" {
122+
env = append(env, "COLORTERM=truecolor")
123+
}
118124
// Ensure UTF-8 locale reaches the container so TUI box-drawing characters
119125
// and icons render correctly (macOS Terminal.app sets LANG on the host but
120126
// Docker exec doesn't inherit it without explicit forwarding).

0 commit comments

Comments
 (0)