Light terminal themes: use the terminal's text color too
On a light background (Catppuccin Latte in Ghostty on macOS) the panes kept palette color 0, a dark grey slab with white text. The probe now also asks for the text color (OSC 10). Light backgrounds are used as well, with text, borders and titles in the terminal's text color, input fields and buttons in a light shade of it, and the active tab drawn in it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019reK4DUGYqDUjniWYJvwUW
This commit is contained in:
@@ -12,9 +12,9 @@ import (
|
||||
"golang.org/x/term"
|
||||
)
|
||||
|
||||
// probeTerminal asks the terminal two things: whether it understands the Kitty
|
||||
// graphics protocol (a tiny query image, which a capable terminal answers with
|
||||
// "OK" and does not show) and its background color (OSC 11). A Primary Device
|
||||
// probeTerminal asks the terminal whether it understands the Kitty graphics
|
||||
// protocol (a tiny query image, which a capable terminal answers with "OK" and
|
||||
// does not show) and for its text and background colors (OSC 10 and 11). A Primary Device
|
||||
// Attributes request follows, which every terminal answers, and answers come
|
||||
// in order: once the DA answer is in, whatever was not answered before it is
|
||||
// not supported. Runs before the screen is set up, on the controlling terminal.
|
||||
@@ -31,7 +31,7 @@ func probeTerminal(timeout time.Duration) (info terminalInfo) {
|
||||
}
|
||||
defer term.Restore(fd, state)
|
||||
|
||||
const query = "\x1b_Gi=31,s=1,v=1,a=q,t=d,f=24;AAAA\x1b\\" + "\x1b]11;?\x1b\\" + "\x1b[c"
|
||||
const query = "\x1b_Gi=31,s=1,v=1,a=q,t=d,f=24;AAAA\x1b\\" + "\x1b]10;?\x1b\\" + "\x1b]11;?\x1b\\" + "\x1b[c"
|
||||
if _, err := tty.WriteString(query); err != nil {
|
||||
return info
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user