Skip to content

Kitty keyboard protocol: CSI > u with omitted flags fails to set flags to 0 #4333

Closed

Description

@2asoft

NOTE: Description written with LLM assistance. Bug found by human frustration :)

2. Issues with the Zellij UI / behavior / crash

Issue description

Zellij fails to implement the push operation for the Kitty keyboard protocol's progressive enhancement stack, specifically the CSI > u sequence. When flags are omitted in the push sequence, Zellij does not default to 0 as required by the protocol. Moreover, omitted flags still cause the progressive enhancements to be enabled.
Pop operations (CSI < u) function correctly, so a pop is required to recover from a push with no flags.

Effects for the user is that after existing some applications, the terminals does not respond to keys like up/down, return, etc, and prints kitty keycodes instead. I ran into this with https://github.com/sst/opencode/, which led me to find that any application using https://github.com/charmbracelet/bubbletea/ v2 is affected, but since Zellij isnt handling this part of the spec, there are likely more applications affected.

Minimal reproduction

  1. Start Zellij with Kitty keyboard protocol support enabled in a host terminal that supports it.
  2. In a pane, send the CSI > u sequence to the terminal, e.g. via printf "\e[>u" from a shell.
  3. Query the current flags with CSI ? u, e.g. printf "\e[?u" from a shell, and observe the printed value.

Expected

Flags are set to 0.

Actual

Flags are set to 1.

Other relevant information

The behaviour of push with omitted flags is equivalent to push with flags. Protocol details from Kitty documentation state that push should handle omitted flags as 0.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions