kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
23.77k stars 959 forks source link

[0.32.0] Multi-key mappings waits indefinitely for defined keymapping to be pressed #7022

Closed mikesmithgh closed 7 months ago

mikesmithgh commented 7 months ago

Describe the bug I have a few multi-key mappings (e.g, map ctrl+w>j). If I press ctrl+w+any non-defined mapping (e.g., ctrl+w+w), then Kitty waits indefinitely until I press a defined mapping. In this case, j. This behavior changed from the previous version of Kitty.

My exact use case is that I am using smart-splits.nvim and when I press ctrl+w+ h or j or k or l, it uses smart-splits.nvim to navigate between Kitty and Neovim windows. But, if I am in Neovim and try to use ctrl+w prefixed mappings like <C-w>b or <C-w>w, then Kitty will hang until I press h or j or k or l.

To Reproduce Steps to reproduce the behavior:

  1. kitty --config mini-kitty.conf
  2. nvim --clean
  3. press <C-w>q Expected Neovim should close Actual Kitty waits until either h or j or k or l is pressed.

Environment details

kitty 0.32.0 (eb5dd364ae) created by Kovid Goyal
Darwin mikes-MBP.fios-router.home 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:55:06 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6020 arm64
ProductName:        macOS ProductVersion:       14.2.1 BuildVersion:        23C71
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /opt/homebrew/bin/bash
Loaded config files:
  /Users/mike/tmp/mini-kitty.conf

Config options different from defaults:
Added shortcuts:
    ctrl+w > j →  neighboring_window down, neighboring_window up, neighboring_window left, neighboring_window right
Removed shortcuts:
    cmd+, →  edit_config_file
    cmd+enter →  new_window
    cmd+h →  hide_macos_app
    cmd+k →  clear_terminal to_cursor active
    cmd+m →  minimize_macos_window
    cmd+n →  new_os_window
    cmd+q →  quit
    cmd+t →  new_tab
    cmd+w →  close_tab
    ctrl+cmd+, →  load_config_file
    ctrl+cmd+f →  toggle_fullscreen
    opt+cmd+h →  hide_macos_other_apps
    opt+cmd+r →  clear_terminal reset active
    opt+cmd+s →  toggle_macos_secure_keyboard_entry
    shift+cmd+/ →  open_url https://sw.kovidgoyal.net/kitty/
    shift+cmd+[ →  previous_tab
    shift+cmd+] →  next_tab
    shift+cmd+d →  close_window
    shift+cmd+w →  close_os_window

Important environment variables seen by the kitty process:
    PATH                                /opt/homebrew/opt/sdkman-cli/libexec/candidates/kotlin/current/bin:/opt/homebrew/opt/sdkman-cli/libexec/candidates/java/current/bin:/opt/homebrew/opt/sdkman-cli/libexec/candidates/gradle/current/bin:/Users/mike/bin:/opt/homebrew/bin:/Users/mike/go/bin:/Users/mike/.config/pyenv/bin:/Users/mike/gitrepos/neovim/build/bin:/Users/mike/.cargo/bin:/opt/homebrew/opt/libpq/bin:/Users/mike/Library/Application Support/Coursier/bin:/Users/mike/.config/pyenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/kitty.app/Contents/MacOS:/Users/mike/bin:/opt/homebrew/bin:/Users/mike/go/bin:/Users/mike/.config/pyenv/bin:/Users/mike/gitrepos/neovim/build/bin:/Users/mike/.cargo/bin:/opt/homebrew/opt/libpq/bin:/Users/mike/Library/Application::/opt/homebrew/opt/fzf/bin
    LANG                                en_US.UTF-8
    VISUAL                              nvim
    EDITOR                              nvim
    SHELL                               /opt/homebrew/bin/bash
    USER                                mike
    XDG_DATA_HOME                       /Users/mike/.local/share
    LC_ALL                              en_US.UTF-8
    XDG_STATE_HOME                      /Users/mike/.local/state
    XDG_CONFIG_HOME                     /Users/mike/.config
    XDG_CACHE_HOME                      /Users/mike/.cache
    XDG_DATA_DIRS                       /usr/local/share
    LC_CTYPE                            en_US.UTF-8
    XDG_RUNTIME_DIR                     /var/folders/52/fp0f1rv10t3_k_q60xk7_lgc0000gn/T/mike.KZZAhM5mPR

Additional context mini-kitty.conf

map ctrl+w>j neighboring_window down
map ctrl+w>k neighboring_window up
map ctrl+w>h neighboring_window left
map ctrl+w>l neighboring_window right
mikesmithgh commented 7 months ago

Thanks, I confirmed the fix is working on nightly 👍