kovidgoyal/kitty · warning · ValueError

Invalid characters in visual_window_select_characters: {x} C

Error message

Invalid characters in visual_window_select_characters: {x} Contains identical numbers or alphabets, case insensitive. Ignoring.

What it means

The second check in visual_window_select_characters: after uppercasing, duplicate characters (case-insensitive) are rejected because len(set) < len(input). Each character must uniquely identify a window.

Source

Thrown at kitty/options/utils.py:820


def resize_debounce_time(x: str) -> tuple[float, float]:
    parts = x.split(maxsplit=1)
    if len(parts) == 1:
        return positive_float(parts[0]), 0.5
    return positive_float(parts[0]), positive_float(parts[1])


def visual_window_select_characters(x: str) -> str:
    import string

    valid_characters = string.digits + string.ascii_uppercase + "-=[]\\;',./`"
    ans = x.upper()
    ans_chars = set(ans)
    if not ans_chars.issubset(set(valid_characters)):
        raise ValueError(f'Invalid characters in visual_window_select_characters: {x} Only numbers (0-9) and alphabets (a-z,A-Z) are allowed. Ignoring.')
    if len(ans_chars) < len(x):
        raise ValueError(f'Invalid characters in visual_window_select_characters: {x} Contains identical numbers or alphabets, case insensitive. Ignoring.')
    return ans


def tab_separator(x: str) -> str:
    for q in '\'"':
        if x.startswith(q) and x.endswith(q):
            x = x[1:-1]
            if not x:
                return ''
            break
    if not x.strip():
        x = ('\xa0' * len(x)) if x else default_tab_separator
    return x


def tab_bar_edge(x: str) -> int:
    match x.lower():
        case 'top':

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Remove duplicate characters (remember comparison is case-insensitive)
  2. Dedupe before writing the value

Example fix

# before
visual_window_select_characters aAbB01
# after
visual_window_select_characters ab01
Defensive patterns

Strategy: validation

Validate before calling

def unique_vwsc(x: str) -> bool:
    return len(set(x.upper())) == len(x)

Prevention

When it happens

Trigger: visual_window_select_characters aA0123... — 'a' and 'A' collapse to the same label.

Common situations: Adding both cases of a letter, or duplicate characters from merging config snippets.

Understand the failure class

Related errors


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