Skip to content

Unicode parsing crash on non-unicode data #8619

Description

@cplir-c

Describe the bug
Dumping significant amounts of binary data into kitty results in a crash from failed parsing?

To Reproduce

  1. run a second kitty instance (with another instance group, if you use -1) and switch to it
  2. Open a directory with several PNG files.
  3. run sort *.png.
  4. The second Kitty crashes, and the first kitty instance will contain the log.

Some probably-representative output:

[10.275] [PARSE ERROR] Unhandled charset related escape code: 0x2a 0x95
[10.275] [PARSE ERROR] Unknown char after ESC: 0x66
[10.275] [PARSE ERROR] Unknown char after ESC: 0x35
[10.275] [PARSE ERROR] Unrecognized APC code: 0xf0
[10.275] [PARSE ERROR] Unknown char after ESC: 0x6f
...
[10.275] [PARSE ERROR] Unknown char after ESC: 0x3b
[10.275] [PARSE ERROR] Invalid character in CSI: 0x9b (0x9b), ignoring the sequence
[10.275] [PARSE ERROR] Unknown char after ESC: 0xd
[10.275] [PARSE ERROR] Unrecognized APC code: 0x7d
[10.276] [PARSE ERROR] Unknown char after ESC: 0x36
...
[10.277] [PARSE ERROR] Unknown char after ESC: 0x66
[10.277] [PARSE ERROR] Unknown char after ESC: 0xe9
[10.277] [glfw error 65544]: Wayland: fatal display error: Broken pipe

Environment details

kitty 0.41.1 created by Kovid Goyal
Linux void 6.12.26_1 #1 SMP PREEMPT_DYNAMIC Sun May  4 21:20:14 UTC 2025 x86_64
Void 6.12.26_1 (void) (/dev/tty)

Running under: Wayland (sway version 1.10) missing: blur icon window-state-suspended
OpenGL: '4.6 (Core Profile) Mesa 24.3.4' Detected version: 4.6
Frozen: False
Fonts:
  medium: DejaVuSansMono: /usr/share/fonts/TTF/DejaVuSansMono.ttf:0
          Features: ()
    bold: DejaVuSansMono-Bold: /usr/share/fonts/TTF/DejaVuSansMono-Bold.ttf:0
          Features: ()
  italic: DejaVuSansMono-Oblique: /usr/share/fonts/TTF/DejaVuSansMono-Oblique.ttf:0
          Features: ()
      bi: DejaVuSansMono-BoldOblique: /usr/share/fonts/TTF/DejaVuSansMono-BoldOblique.ttf:0
          Features: ()
Paths:
  kitty: /usr/bin/kitty
  base dir: /usr/lib/kitty
  extensions dir: /usr/lib/kitty/kitty
  system shell: /bin/fish
System color scheme: no_preference. Applied color theme type: none
Loaded config files:
  /home/user/.config/kitty/kitty.conf

Config options different from defaults:
input_delay          5
linux_display_server wayland
repaint_delay        15

Important environment variables seen by the kitty process:
	PATH                                /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:/home/user/.local/bin:/home/user/.cargo/bin
	LANG                                en_US.UTF-8
	EDITOR                              nvim
	SHELL                               /bin/fish
	DISPLAY                             :0
	WAYLAND_DISPLAY                     wayland-1
	USER                                user
	XCURSOR_SIZE                        24
	XDG_SESSION_TYPE                    wayland
	LC_COLLATE                          C
	XDG_RUNTIME_DIR                     /run/user/user
	XDG_DATA_DIRS                       /home/user/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share

Additional context
Also reproduced with --config NONE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions