{"record":{"id":"e6121ac7a502a431","repo":"kovidgoyal/kitty","slug":"terminal-does-not-support-querying-the-s","errorCode":null,"errorMessage":"Terminal does not support querying the: %s","messagePattern":"Terminal does not support querying the: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/choose_fonts/ui.go","lineNumber":117,"sourceCode":"\t\th.lp.WakeupMainThread()\n\t}()\n\th.draw_screen()\n\treturn\n}\n\nfunc (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}","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/choose_fonts/ui.go#L99-L135","documentation":"The choose_fonts kitten queries the terminal for capabilities (font_size, cell width/height, etc.) and expects a valid response. If the terminal answers with an invalid/unsupported indicator, this error is returned. It typically means the terminal is not kitty or lacks the required private query modes.","triggerScenarios":"Running the choose_fonts kitten inside a terminal that does not implement kitty's font-size/cell-size query escape sequences, or where a query response arrives marked invalid.","commonSituations":"Running kitty kittens inside tmux/screen without proper passthrough, or in another terminal emulator (gnome-terminal, xterm) via the kitten CLI; nested sessions mangling DCS responses.","solutions":["Run the kitten inside kitty itself","If under tmux/screen, enable escape passthrough or run kitty directly outside the multiplexer","Update kitty — older versions lack some query support"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify TERM_PROGRAM=kitty before launching the kitten\nif os.Getenv(\"TERM_PROGRAM\") != \"kitty\" { return errors.New(\"run inside kitty\") }","typeGuard":null,"tryCatchPattern":"if err := h.on_query_response(k, v, valid); err != nil { fmt.Fprintln(os.Stderr, \"terminal lacks query support:\", err); os.Exit(1) }","preventionTips":["Run kittens inside kitty, not other terminals","Avoid nesting kittens under tmux/screen without passthrough"],"tags":["kitty","terminal-capabilities","query-response","choose-fonts"],"backgroundTag":"terminal-capability-query-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}