kovidgoyal/kitty · warning
Ignoring invalid paste string:
Error message
Ignoring invalid paste string:
What it means
The paste action's argument string could not be parsed as ANSI-C escapes (defines.expand_ansi_c_escapes raised). kitty logs and substitutes an empty string, so the paste inserts nothing.
Source
Thrown at kitty/options/utils.py:280
@func_with_args('copy_to_buffer')
def copy_to_buffer(func: str, rest: str) -> FuncArgsType:
return func, [rest]
@func_with_args('paste_from_buffer')
def paste_from_buffer(func: str, rest: str) -> FuncArgsType:
return func, [rest]
@func_with_args('paste')
def paste_parse(func: str, rest: str) -> FuncArgsType:
text = ''
try:
text = defines.expand_ansi_c_escapes(rest)
except Exception:
log_error('Ignoring invalid paste string: ' + rest)
return func, [text]
@func_with_args('neighboring_window')
def neighboring_window(func: str, rest: str) -> FuncArgsType:
rest = rest.lower()
rest = {'up': 'top', 'down': 'bottom'}.get(rest, rest)
if rest not in ('left', 'right', 'top', 'bottom'):
log_error(f'Invalid neighbor specification: {rest}')
rest = 'right'
return func, [rest]
@func_with_args('resize_window')
def resize_window(func: str, rest: str) -> FuncArgsType:
vals = rest.strip().split(maxsplit=1)
if len(vals) > 2:
log_error('resize_window needs one or two arguments, using defaults')View on GitHub (pinned to 6d5d0c4406)
Solutions
- Use valid ANSI-C escapes: \e for escape, \n for newline, \xNN hex codes
- Quote the string appropriately in kitty.conf so backslashes survive to the parser
Example fix
# before map f1 paste \control # after map f1 paste \e[A
Defensive patterns
Strategy: validation
Validate before calling
from kitty.fast_data_types import expand_ansi_c_escapes # or replicate
try:
expand_ansi_c_escapes(r'\e[A'); ok = True
except Exception:
ok = False Prevention
- Use only documented C escapes (\\, \n, \t, \e, \xNN, \NNN octal)
- Test paste strings in isolation before adding them to kitty.conf
When it happens
Trigger: `map f1 paste \q` or any malformed escape sequence like an unterminated/unknown \-escape in the paste argument.
Common situations: Trying to paste special characters with backslash escapes without using valid C-style escapes (\n, \t, \e, \xNN, etc.), or shell-level escaping accidentally corrupting the config string.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Invalid paste actions: {q - s}, ignoring
- Unknown signal: {rest} ignoring
- Invalid change_font_size specification: {rest}, treating it
- clear_terminal needs two arguments, using defaults
- {action} is unknown for clear_terminal, using reset
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/3d89f6843de89a01.
Report an issue: GitHub.