wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
18.12k stars 809 forks source link

Kitty keyboard: ctrl+space release produce wrong sequence #6160

Open aymanbagabas opened 2 months ago

aymanbagabas commented 2 months ago

What Operating System(s) are you seeing this problem on?

macOS

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

wezterm 20240918-064917-832c533c

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

When using Kitty keyboard report release events feature, WezTerm sends the wrong release sequence for ctrl+space.

image

Notice ^@ indicating a ctrl+space key press, followed by the release CSI u sequence ^[[0;5:3u.

To Reproduce

  1. stty raw && printf '\x1b[>3u' && cat -e # enables Kitty keyboard keys disambiguation and release events
  2. Press ctrl+space

Configuration

local wezterm = require("wezterm");

-- This will hold the configuration.
local config = wezterm.config_builder()

config.color_scheme = "OneDark (base16)"
config.font = wezterm.font("Inconsolata LGC")

-- Enable Kitty keyboard
config.enable_kitty_keyboard = true

return config

Expected Behavior

WezTerm should return \x1b[32;5u and \x1b[32;5:3u instead of ^@ and \x1b[0;5:3u since release events progressive enhancement is on in this case.

Logs

No response

Anything else?

No response

tmccombs commented 5 days ago

I can't reproduce this on 20240203-110809-5046fc22 on archlinux.