{"record":{"id":"63e62c58a20e67d4","repo":"kovidgoyal/kitty","slug":"invalid-response-from-terminal-to-s-query-v","errorCode":null,"errorMessage":"Invalid response from terminal to %s query: %#v","messagePattern":"Invalid response from terminal to (.+?) query: %#v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/choose_fonts/ui.go","lineNumber":123,"sourceCode":"func (h *handler) finalize() {\n\tif h.temp_dir != \"\" {\n\t\tos.RemoveAll(h.temp_dir)\n\t\th.temp_dir = \"\"\n\t}\n\th.lp.SetCursorVisible(true)\n\th.lp.SetCursorShape(loop.BLOCK_CURSOR, true)\n\th.graphics_manager.finalize()\n}\n\nfunc (h *handler) on_query_response(key, val string, valid bool) error {\n\tif !valid {\n\t\treturn fmt.Errorf(\"Terminal does not support querying the: %s\", key)\n\t}\n\tset_float := func(k, v string, dest *float64) error {\n\t\tif fs, err := strconv.ParseFloat(v, 64); err == nil {\n\t\t\t*dest = fs\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"Invalid response from terminal to %s query: %#v\", k, v)\n\t\t}\n\t\treturn nil\n\t}\n\tswitch key {\n\tcase \"font_size\":\n\t\tif err := set_float(key, val, &h.text_style.Font_sz); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase \"dpi_x\":\n\t\tif err := set_float(key, val, &h.text_style.Dpi_x); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase \"dpi_y\":\n\t\tif err := set_float(key, val, &h.text_style.Dpi_y); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase \"foreground\":\n\t\th.text_style.Foreground = val","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/choose_fonts/ui.go#L105-L141","documentation":"After the terminal answers a capability query, the response value is parsed as a float (font size, cell metrics). If parsing fails, this error reports the offending query key and raw value. It indicates the terminal returned a malformed numeric response.","triggerScenarios":"Terminal sends a non-numeric reply to the font_size or cell-width/height query (e.g. empty string or garbage), which strconv.ParseFloat rejects.","commonSituations":"Interference from shell prompt escape sequences corrupting query responses, tmux/screen mangling DCS replies, or a non-kitty terminal echoing the query back.","solutions":["Run inside real kitty without multiplexer interference","Disable shell integration/prompt escape codes that answer queries incorrectly","Update kitty to latest version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if _, err := strconv.ParseFloat(val, 64); err != nil {\n\treturn fmt.Errorf(\"terminal sent garbage for %s: %q\", key, val)\n}","typeGuard":null,"tryCatchPattern":"if err := set_float(key, val, &dest); err != nil { /* treat terminal as incapable, fall back to defaults */ }","preventionTips":["Keep terminal emulators updated","Disable prompt escape sequences that answer capability queries"],"tags":["kitty","parse-error","terminal-query","float-parsing"],"backgroundTag":"terminal-query-response-malformed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}