detached 49ed8a6

fix(query): accept Kitty primary attributes response

commit
49ed8a6f7dd108d8cf4d8286fa320325a620f4ba
author
brice · · 2026-08-26 11:02 UTC
parent
16f5a24
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +5 -2
M protocol/terminalquery/query.go +4 -2
@@ -176,7 +176,7 @@ func validDA1Response(data []byte) bool {
176176 // not sufficient for a direct graphics declaration. The parameter body is
177177 // a non-empty semicolon-separated list of decimal numbers.
178178 body := data[3 : len(data)-1]
179- if len(body) == 0 || body[0] == ';' || body[len(body)-1] == ';' {
179+ if len(body) == 0 || body[0] == ';' {
180180 return false
181181 }
182182 previousSeparator := false
@@ -193,7 +193,9 @@ func validDA1Response(data []byte) bool {
193193 return false
194194 }
195195 }
196- return !previousSeparator
196+ // Kitty terminates its DA1 parameter list with a separator. DEC treats the
197+ // resulting empty final parameter as zero, so both forms are valid.
198+ return true
197199 }
198200
199201 func suffixPrefixLen(data []byte) int {
@@ -176,7 +176,7 @@ func validDA1Response(data []byte) bool {
176 // not sufficient for a direct graphics declaration. The parameter body is176 // not sufficient for a direct graphics declaration. The parameter body is
177 // a non-empty semicolon-separated list of decimal numbers.177 // a non-empty semicolon-separated list of decimal numbers.
178 body := data[3 : len(data)-1]178 body := data[3 : len(data)-1]
179- if len(body) == 0 || body[0] == ';' || body[len(body)-1] == ';' {179+ if len(body) == 0 || body[0] == ';' {
180 return false180 return false
181 }181 }
182 previousSeparator := false182 previousSeparator := false
@@ -193,7 +193,9 @@ func validDA1Response(data []byte) bool {
193 return false193 return false
194 }194 }
195 }195 }
196- return !previousSeparator196+ // Kitty terminates its DA1 parameter list with a separator. DEC treats the
197+ // resulting empty final parameter as zero, so both forms are valid.
198+ return true
197 }199 }
198 200
199 func suffixPrefixLen(data []byte) int {201 func suffixPrefixLen(data []byte) int {
M protocol/terminalquery/query_test.go +1 -0
@@ -15,6 +15,7 @@ func TestProbeRequiresKittyAndDA1(t *testing.T) {
1515 unrelated string
1616 }{
1717 {name: "both and input", data: "x\x1b[?1;2c" + "\x1b_Gi=31;OK\x1b\\y", kitty: true, da1: true, unrelated: "xy"},
18+ {name: "kitty DA1 with trailing separator", data: "\x1b_Gi=31;OK\x1b\\\x1b[?62;52;c", kitty: true, da1: true},
1819 {name: "secondary DA is insufficient", data: "\x1b[>1;2c\x1b_Gi=31;OK\x1b\\", kitty: true, unrelated: "\x1b[>1;2c"},
1920 {name: "ordinary input", data: "hello", unrelated: "hello"},
2021 } {
@@ -15,6 +15,7 @@ func TestProbeRequiresKittyAndDA1(t *testing.T) {
15 unrelated string15 unrelated string
16 }{16 }{
17 {name: "both and input", data: "x\x1b[?1;2c" + "\x1b_Gi=31;OK\x1b\\y", kitty: true, da1: true, unrelated: "xy"},17 {name: "both and input", data: "x\x1b[?1;2c" + "\x1b_Gi=31;OK\x1b\\y", kitty: true, da1: true, unrelated: "xy"},
18+ {name: "kitty DA1 with trailing separator", data: "\x1b_Gi=31;OK\x1b\\\x1b[?62;52;c", kitty: true, da1: true},
18 {name: "secondary DA is insufficient", data: "\x1b[>1;2c\x1b_Gi=31;OK\x1b\\", kitty: true, unrelated: "\x1b[>1;2c"},19 {name: "secondary DA is insufficient", data: "\x1b[>1;2c\x1b_Gi=31;OK\x1b\\", kitty: true, unrelated: "\x1b[>1;2c"},
19 {name: "ordinary input", data: "hello", unrelated: "hello"},20 {name: "ordinary input", data: "hello", unrelated: "hello"},
20 } {21 } {

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 2

Tags 13

↑↓ moveenter openesc close