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

Visual button for Quit visible in locked mode when disabled #3455

Open
vincentqb opened this issue Jun 26, 2024 · 5 comments
Open

Visual button for Quit visible in locked mode when disabled #3455

vincentqb opened this issue Jun 26, 2024 · 5 comments

Comments

@vincentqb
Copy link

vincentqb commented Jun 26, 2024

I've disabled the Quit keyboard shortcut, as below.

keybinds clear-defaults=true {
    locked {
        bind "Ctrl g" { SwitchToMode "Normal"; }
    }
    shared_except "locked" {
        bind "Ctrl g" { SwitchToMode "Locked"; }
        // bind "Ctrl q" { Quit; }
        bind "Alt n" { NewPane; }
        bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
        bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
        bind "Alt j" "Alt Down" { MoveFocus "Down"; }
        bind "Alt k" "Alt Up" { MoveFocus "Up"; }
        bind "Alt =" "Alt +" { Resize "Increase"; }
        bind "Alt -" { Resize "Decrease"; }
    }
...
}

As desired, the <> Quit visual button disappears from the bar. But not from the locked mode bar, see images below.

zellij_locked zellij_unlocked

Is that intentional or it should also be hidden from there? Thanks!

zellij --version: zellij 0.40.1

@Zykino
Copy link
Contributor

Zykino commented Jun 26, 2024

Yeah, un-commenting does not `unbind.
There are 3 possibilities that I know of:

  1. unbind the shortcut
  2. Override it (if I remember correctly you can do with: bind "Ctrl q" { })
  3. Read (and do) as the first line of the first line of the dumped config tells you to (the commented one ;) )

@vincentqb
Copy link
Author

I've tried to un/comment lines with "Ctrl q" without success. Is that what you meant?

keybinds clear-defaults=true {
    unbind "Ctrl q"
    locked {
        bind "Ctrl g" { SwitchToMode "Normal"; }
        bind "Ctrl q" { }
    }
    shared_except "locked" {
        bind "Ctrl g" { SwitchToMode "Locked"; }
        // bind "Ctrl q" { Quit; }
        bind "Alt n" { NewPane; }
        bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
        bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
        bind "Alt j" "Alt Down" { MoveFocus "Down"; }
        bind "Alt k" "Alt Up" { MoveFocus "Up"; }
        bind "Alt =" "Alt +" { Resize "Increase"; }
        bind "Alt -" { Resize "Decrease"; }
    }
...
}

The keyboard settings from the default configuration from zellij setup --dump-config are very close to mine otherwise :) Is that what you meant in 3? Thanks again!

@Zykino
Copy link
Contributor

Zykino commented Jun 27, 2024

Yeah, it one ore or the other 😅
Just the clear-defaults=true should be enough if you ends up dumping and configuring your config from there. Note that zellij does not reload its config. You will have to start another session to get the new bindings.

For the option 1: you did override, but not "inplace", so I’m not sure it will work.

@vincentqb
Copy link
Author

Just to be clear, I have the keyboard bindings working :) I'm really just talking about the little visual Quit icon that remains in locked mode despite not representing any binding. That icon is successfully removed when unlocked. I attached images to the issue to emphasize what I mean. :) Thanks again!

@Zykino
Copy link
Contributor

Zykino commented Jun 28, 2024

Oh! I did not understood that!
Yeah I have the same "glitch". Never noticed in a year of usage 😅 Thanks for reporting.

I think the underlying issue is that this bar’s shortcut’s presentation is more or less hardcoded. Like I moved the Quit action to only be activated when I’m on the "session mode". If I try to set it to only q then it is still shown in the first bar instead of the second one (like <d> Detach is).

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

2 participants