mirror of
https://github.com/donlucasx/xscapes.git
synced 2026-10-20 08:43:32 +02:00
His first run in Ghostty. The sun differed because Ghostty took the truecolor profile and painted the palette's raw blend, a flat tan, where Terminal.app's quantiser lands on peach over cream: DetectProfile now returns the 256 cube on every terminal and COLORTERM is not consulted; XSCAPES_COLOR=truecolor opts in. The layout broke on a resize because Ghostty 1.3.1's alternate screen, read from its source, keeps content at the top on a grow and moves the cursor with its row on a shrink, and restores DECRC verbatim, where Terminal.app is bottom-anchored with the cursor unmoved: host.Rules, picked by RulesFor on TERM_PROGRAM, keeps Terminal.app's sequences byte for byte and gives everything else no SU on a grow and RebindShrinkAltFollow on a shrink. Red first in ghostty_resize_test.go, Ghostty's rules in the screen model (resizeGhostty, screen.restoreAbsolute), eight geometries. notes/sunprobe renders the noon sun under both profiles; the screenshot pixels also showed Terminal.app's U+2580 glyph starting 5px below the cell top, the hairline at every half-block edge that Ghostty does not draw. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8uiSPv8yHadvci8xGpjyK
32 lines
1.1 KiB
Go
32 lines
1.1 KiB
Go
package term
|
|
|
|
import "testing"
|
|
|
|
// Every terminal gets the cube. The scene is designed for it, and a truecolor
|
|
// terminal painting the palette's raw blends showed a different picture (a tan
|
|
// sun where Terminal.app shows peach over cream, notes/sunprobe, 2026-09-04).
|
|
// COLORTERM was already untrustworthy (Terminal.app exports truecolor inside
|
|
// Claude Code); now it is not consulted at all. XSCAPES_COLOR still opts in.
|
|
func TestEveryTerminalGetsTheCube(t *testing.T) {
|
|
t.Setenv("XSCAPES_COLOR", "")
|
|
t.Setenv("ASCIISCAPES_COLOR", "")
|
|
for _, tc := range []struct{ prog, colorterm string }{
|
|
{"Apple_Terminal", "truecolor"},
|
|
{"ghostty", "truecolor"},
|
|
{"iTerm.app", "truecolor"},
|
|
{"WezTerm", "24bit"},
|
|
{"", "truecolor"},
|
|
{"", ""},
|
|
} {
|
|
t.Setenv("TERM_PROGRAM", tc.prog)
|
|
t.Setenv("COLORTERM", tc.colorterm)
|
|
if got := DetectProfile(); got != Profile256 {
|
|
t.Errorf("TERM_PROGRAM=%q COLORTERM=%q: profile %s, want 256", tc.prog, tc.colorterm, got)
|
|
}
|
|
}
|
|
t.Setenv("XSCAPES_COLOR", "truecolor")
|
|
if got := DetectProfile(); got != ProfileTrueColor {
|
|
t.Errorf("XSCAPES_COLOR=truecolor: profile %s, want truecolor", got)
|
|
}
|
|
}
|