zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
21.19k stars 644 forks source link

Invalid key: 'Alt Enter' when trying to bind Alt Enter #2478

Open Iduoad opened 1 year ago

Iduoad commented 1 year ago

I am trying to bind Alt Enter

bind "Alt Enter" { NewPane; SwitchToMode "Normal"; }
bind "Alt Tab" { NewTab; SwitchToMode "Normal"; }

And I am getting an error:

5 │         bind "Alt Enter" { NewPane; SwitchToMode "Normal"; }
   ·         ──────────────────────────┬─────────────────────────
   ·                                   ╰── Invalid key: 'Alt Enter'

Link of the Discussion #2477

Lockszmith-GH commented 1 year ago

I think #735 is an issue rooted in the same reason this isn't possible.

BTW: If you open a discussion and an Issue, it's good form to link them both. All you need is to mention the number in each: #2477

Iduoad commented 1 year ago

Thank you for the answer. I see #735 is about binding 2 modifiers + a character. Is Enter and Tab considered modifiers too?

I am able to bind Alt+Enter and Alt+Tab in Tmux, but not in Zellij.

Lockszmith-GH commented 1 year ago

Now I'm interested as well :) If it works in tmux, then there is probably a way for Zellij to support it. (BTW, I linked the other issue, because it refers to the way key-capture works and it's limitations - I know the title is about a different issue)

Keeping an eye here with you, hopefully one of the maintainers will catch a glimps.

bonsairobo commented 1 year ago

I have a similar issue trying to change a binding:

× Failed to parse Zellij configuration
     ╭─[.config/zellij/config.kdl:181:1]
 181 │     shared_except "tmux" "locked" {
 182 │         bind "Ctrl Space" { SwitchToMode "Tmux"; }
     ·         ─────────────────────┬────────────────────
     ·                              ╰── Invalid key: 'Ctrl Space'
 183 │     }
     ╰────
  help: For more information, please see our configuration guide: https://
        zellij.dev/documentation/configuration.html

This binding has worked fine for me in tmux.

oredaze commented 9 months ago

I would absolutely love to bind Alt Enter to NewPane :( and Alt Tab to ToggleFloatingPanes...

rousbound commented 7 months ago

Similar problem with:

bind "Ctrl Tab" { GoToNextTab; }
    ·                 ────────────────┬───────────────
    ·                                 ╰── Invalid key: 'Ctrl Tab'
radutomy commented 1 month ago

Similar problem with:

bind "Ctrl Tab" { GoToNextTab; }
    ·                 ────────────────┬───────────────
    ·                                 ╰── Invalid key: 'Ctrl Tab'

I'm trying to do the same exact same thing... anyone got a solution for this?

johanbluecreek commented 1 month ago

I just found a work-around by making zellij action bindings for the terminal instead. Maybe this can help people here too. My example:

$ cat .config/kitty/kitty.conf

map alt+enter launch --type background --cwd /home/user/ zellij action new-pane --floating
map alt+space launch --type background zellij action toggle-floating-panes
map alt+shift+space launch --type background zellij action toggle-pane-embed-or-floating
map alt+shift+right launch --type background zellij action move-pane right
map alt+shift+left launch --type background zellij action move-pane left
map alt+shift+up launch --type background zellij action move-pane up
map alt+shift+down launch --type background zellij action move-pane down
fnuttens commented 4 weeks ago

Reproducing with Ctrl-Backspace:

 13 │     unbind "Ctrl Backspace"
    ·     ───────────┬───────────
    ·                ╰── Invalid key: 'Ctrl Backspace'