Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zellij hijacks "ctrl+shift+right" and "alt+shift+right" keybindings defined in iTerm2 #3769

Open
cmontemuino opened this issue Nov 14, 2024 · 1 comment

Comments

@cmontemuino
Copy link

cmontemuino commented Nov 14, 2024

Basic information

zellij --version: zellij 0.41.1

stty size: 63 237

uname -av or ver(Windows): Darwin hostname 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:15 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6000 arm64

Further information

Reproduction steps, noticeable behavior, related issues, etc

2. Issues with the Zellij UI / behavior / crash

  • Run iTerm2
  • Go to Settings, pick the current profile, then lick on Keys and select Key Mappings tab
  • Define a key mapping for any of the following combinations: "ctrl+shift+right", "alt+shift+right"

It does not matter how I configure the Rebind leaders. It's completely the same using Ctrl as primary + Alt as Secondary or the other way around.

Whatever the configuration, when I hit one of the mappings defined for iTerm2, I experience a floating pane toggle, even with the interface locked.

  • For example, if I configure "ctrl+shift+right" in iTerm to send escape sequence "f", this combination is hijacked by zellij. Hitting "ctrl+alt+right" prints ;4C, which is expected because I have no keybindings for it in iTerm.
  • If I do the opposite, that is configuring the keybinding "alt+shift+right", then zellij hijacks it and "ctrl+shift+right" just prints an output to the terminal.
@cmontemuino
Copy link
Author

I found a workaround: use a tweaked version of example/alt-centered-config.kdl

I needed to use the following setting instead:

    pane clear-defaults=true {
        bind "Enter" "Esc" "Space" { SwitchToMode "normal"; }
        bind "c" { SwitchToMode "renamepane"; PaneNameInput 0; }
        bind "d" { NewPane "down"; SwitchToMode "normal"; }
        bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "normal"; }
        bind "h" "Left" { NewPane "Left"; }
        bind "l" "Right" { NewPane "Right"; }
        bind "f" { ToggleFocusFullscreen; SwitchToMode "normal"; }
        bind "j" "Down" { NewPane "Down"; }
        bind "k" "Up" { NewPane "Up"; }
        bind "Alt h" "Left" { MoveFocus "Left"; }
        bind "Alt l" "Right" { MoveFocus "Right"; }
        bind "Alt j" "Down" { MoveFocus "Down"; }
        bind "Alt k" "Up" { MoveFocus "Up"; }
        bind "p" { SwitchFocus; }
        bind "Ctrl p" { SwitchToMode "normal"; }
        bind "n" { NewPane; }
        bind "x" { CloseFocus; }
        bind "r" { NewPane "right"; SwitchToMode "normal"; }
        bind "w" { ToggleFloatingPanes; SwitchToMode "normal"; }
        bind "z" { TogglePaneFrames; SwitchToMode "normal"; }
    }

There's no way to make "alt+p" work; thus I needed to change it to "ctrl+p". Not 100% satisfactory, but now I have a working configuration again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant