zellij-org / zellij

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

Clarify and extend documentation about available keys #2627

Open TheSast opened 1 year ago

TheSast commented 1 year ago
  1. Currently the documentation in question is not clear on what a character is.

    Assuming it is any key on a 110 key keyboard using the standard US layout with a 1-1 representation in utf8 then this does not make sense since bindings like Ctrl 2 or Ctrl > are allowed by the config file but fail to perform any behaviour when Zellij is running.

    Assuming it is any key that has a 1-1 representation in the latin alphabet then excludes any bindings that include symbols such as Alt ) which works correctly when bound in Zellij

  2. It is unclear weather or not Left, Right, Up, Down allow modifiers

    This is due to them being repeated both in the "Possible keys with the Alt modifier" and "Possible keys without a modifier" section.

Zykino commented 1 year ago

Assuming it is any key on a 110 key keyboard using the standard US layout […]

This assumption is clearly wrong: French use an AZERTY keyboard and the number in the number rows are accessed with the Shift modifier. Also I use a BÉPO keyboard at home (equivalent of DVORAK: optimized for typing speed typing left then right, …) And the top row is as follow (on my setup that may not be one of the standards one) : "«»()@+-/* Particular attention to the "«»" which are french traditional quotes that should not exist on any US keyboard.

Here is a snip of my working config for shortcut going to a tab directly ( work on both alacritty and gnome-terminal):

keybinds {
    normal {
        // uncomment this and adjust key if using copy_on_select=false
        // bind "Alt c" { Copy; }
        bind "Alt \"" { GoToTab 1; }
        bind "Alt «" "«" { GoToTab 2; }
        bind "Alt »" "»" { GoToTab 3; }
        bind "Alt (" { GoToTab 4; }
        bind "Alt )" { GoToTab 5; }
        bind "Alt @" { GoToTab 6; }
        bind "Alt +" { GoToTab 7; }
        bind "Alt -" { GoToTab 8; }
        bind "Alt /" { GoToTab 9; }
        bind "Alt *" { GoToTab 10; }
    }
    // […]

So all of that and clinking the documentation later :sweat_smile: to say that maybe just telling apart number and character is sufficient? (To my testings, numbers works with Alt but not Ctrl, the <> keys already need AltGr so Ctrl + AltGr + < is impractical.)

In the end it is a variation of "it depends on your keyboard layout, and the STDIN channel between the terminal and the shell (and it with Zellij).

Also while I’m here, some "strange characters" like at least one of this spaces also works.

In the end the website can only give hints to try things, the best option is => Just try it, if it works for you then its good ! (And this plugin may be a good start to try things : https://github.com/tlinford/zellij-echo/)

TheSast commented 1 year ago

the <> keys already need AltGr so Ctrl + AltGr + < is impractical Not all layouts need AltGr to be pressed to access < and > since not all layout have an AltGr key.

Zykino commented 1 year ago

Sure, but that is the problem: testing everything is not practical for keybindings users will have to each test their setup themself. :)

rafaelpirolla commented 6 days ago

I see you mentioning AltGr here but I cannot use AltGr to access shortcuts like the floating pane with the default AltGr + f.

Zykino commented 6 days ago

Whoa old question. For the issue… now zellij is using the kitty keyboard protocol (since 0.41 that is out since 1 week ago).

I’m using the BÉPO layout. I was just saying that for me, accessing "<" is possible by using the Alt Gr layer + the « char (which is usually the 2 key in QWERTY, but the numbers on this row are on the Shift layer in BÉPO and AZERTY which are french layouts).

I don’t think zellij will ever kknow about the Alt Gr key press, it just tell the OS or keyboard that another char is to send than the usual one for this key.

rafaelpirolla commented 6 days ago

Interesting layout – I use DVORAK. Thanks for the tip! I can actually use just the produced key with AltGr to create the bind! Since AltGr + f = ƒ then I just can bind ƒ to whatever, as long as it's not a dead key probably (I'm using ABC Extended on MacOS).