{"record":{"id":"3ba6319e92273951","repo":"kovidgoyal/kitty","slug":"terminal-did-not-report-the-cursor-position-as-man","errorCode":null,"errorMessage":"Terminal did not report the cursor position as many times as expected. %d != %d","messagePattern":"Terminal did not report the cursor position as many times as expected\\. (.+?) != (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tools/cli/wcswidth_kitten.go","lineNumber":149,"sourceCode":"\t\t\t\t\t} else {\n\t\t\t\t\t\tnum_reports++\n\t\t\t\t\t\tt := tests[current_test_idx]\n\t\t\t\t\t\tif len(t.actual_cursor_positions) >= len(t.expected_cursor_positions) && current_test_idx+1 < len(tests) {\n\t\t\t\t\t\t\tcurrent_test_idx += 1\n\t\t\t\t\t\t\tt = tests[current_test_idx]\n\t\t\t\t\t\t}\n\t\t\t\t\t\tt.actual_cursor_positions = append(t.actual_cursor_positions, cpos)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\tif err = lp.Run(); err != nil {\n\t\treturn err\n\t}\n\tif num_reports != expected_num_reports {\n\t\treturn fmt.Errorf(\"Terminal did not report the cursor position as many times as expected. %d != %d\", expected_num_reports, num_reports)\n\t}\n\treturn show_results(tests, screen_width)\n}\n\nfunc show_results(tests []*test_struct, screen_width int) (err error) {\n\tnum_failures := 0\n\tfor _, t := range tests {\n\t\tdiff := \"\"\n\t\tif t.tester == nil {\n\t\t\tac := make([]int, len(t.actual_cursor_positions))\n\t\t\tfor i, cp := range t.actual_cursor_positions {\n\t\t\t\tac[i] = cp.x\n\t\t\t}\n\t\t\tdiff = cmp.Diff(t.expected_cursor_positions, ac)\n\t\t} else {\n\t\t\tdiff = t.tester(t.actual_cursor_positions, screen_width)\n\t\t}\n\t\tif diff != \"\" {","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/tools/cli/wcswidth_kitten.go#L131-L167","documentation":"The wcswidth kitten ran its width tests and counted the number of cursor position reports the terminal sent back, but the count differs from the number of tests it expected. This means reports were lost, duplicated, or the terminal stopped responding mid-run.","triggerScenarios":"run_tests executes N tests each expecting one CPR; if num_reports != expected_num_reports (reports dropped due to tty buffering, timing, or a terminal that stops answering), the error is returned.","commonSituations":"Slower or non-conformant terminals losing responses, tmux/screen interference, resizing the window during the run, or output from other programs polluting the report stream.","solutions":["Re-run the kitten; transient tty timing issues often resolve themselves","Run directly in kitty or another conformant terminal without multiplexers","Avoid interacting with/resizing the terminal while tests run","Update kitty so kitten and terminal versions match"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := run_tests(...); err != nil && strings.Contains(err.Error(), \"did not report\") { /* retry once */ }","preventionTips":["Don't resize or type in the terminal during the test run","Run in a quiet terminal without concurrent output"],"tags":["kitty","terminal","cpr","test-runner"],"backgroundTag":"terminal-response-mismatch","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}