kovidgoyal/kitty · error

Terminal did not report the cursor position as many times as

Error message

Terminal did not report the cursor position as many times as expected. %d != %d

What it means

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.

Source

Thrown at tools/cli/wcswidth_kitten.go:149

					} else {
						num_reports++
						t := tests[current_test_idx]
						if len(t.actual_cursor_positions) >= len(t.expected_cursor_positions) && current_test_idx+1 < len(tests) {
							current_test_idx += 1
							t = tests[current_test_idx]
						}
						t.actual_cursor_positions = append(t.actual_cursor_positions, cpos)
					}
				}
			}
		}
		return nil
	}
	if err = lp.Run(); err != nil {
		return err
	}
	if num_reports != expected_num_reports {
		return fmt.Errorf("Terminal did not report the cursor position as many times as expected. %d != %d", expected_num_reports, num_reports)
	}
	return show_results(tests, screen_width)
}

func show_results(tests []*test_struct, screen_width int) (err error) {
	num_failures := 0
	for _, t := range tests {
		diff := ""
		if t.tester == nil {
			ac := make([]int, len(t.actual_cursor_positions))
			for i, cp := range t.actual_cursor_positions {
				ac[i] = cp.x
			}
			diff = cmp.Diff(t.expected_cursor_positions, ac)
		} else {
			diff = t.tester(t.actual_cursor_positions, screen_width)
		}
		if diff != "" {

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Re-run the kitten; transient tty timing issues often resolve themselves
  2. Run directly in kitty or another conformant terminal without multiplexers
  3. Avoid interacting with/resizing the terminal while tests run
  4. Update kitty so kitten and terminal versions match
Defensive patterns

Strategy: retry

Try / catch

if err := run_tests(...); err != nil && strings.Contains(err.Error(), "did not report") { /* retry once */ }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/3ba6319e92273951. Report an issue: GitHub.