zellij
zellij copied to clipboard
Feature request regarding Ctrl-Q
Since I have now accidently used "Ctrl-Q" many times I would like to ask whether there can be done something preventing this.
Maybe a more complicated action or some question whether you really want to do it.
Closing everything is nothing I normally do intend to do so it would be good to change this.
Hey! I am working on including this feature. And some preliminary work has been done to support it.
Related issues: #933, #467
Here is a preview of the prototype:
Great. I found this comment in #467: "Also on other "terminating" operations, like "tab close" and "pane close".
I can confirm this. It is not a normal workflow that you want to close a tab. Normally such thing only happens by accident. So it would be good to have also this protection for tabs and panes.
Great. I found this comment in #467: "Also on other "terminating" operations, like "tab close" and "pane close".
I can confirm this. It is not a normal workflow that you want to close a tab. Normally such thing only happens by accident. So it would be good to have also this protection for tabs and panes.
I do sometimes want to close many panes quickly. Maybe we add a confirmation for closing a tab/pane, and also add a "force close" shortcut (eg. ctrl-p
+ x
=> close with confirmation, ctrl-p
+ X
=> close without confirmation)
I usually close zellij by closing the shell with Ctrl + D, I'm guessing that will remain without confirmation?
Yes, since that isn't an action.
I usually close zellij by closing the shell with Ctrl + D, I'm guessing that will remain without confirmation?
There's also not a lot we can do about this, tbh. We only intercept keys to the shell if they correspond to one of our UI actions. This is an internal shell thing - for one shell it can be ctrl + d, for another it can be something else.
Maybe we add a confirmation for closing a tab/pane, and also add a "force close" shortcut
I feel like using a "double key" could solve the problem: The first x
leading to a confirmation question with x
as 'yes' and any other key as 'no'.
If you really want to close something, it is easy to get the double keypress into muscle memory, while inadvertently pressing the close combination twice seems unlikely.
This should also play nice with key remapping.
Since it wasn't mentioned already, it is totally possible to remap the offending actions to keys that are more difficult to hit by accident or remove the mapping altogether: https://zellij.dev/documentation/keybindings.html
Since it wasn't mentioned already, it is totally possible to remap the offending actions to keys that are more difficult to hit by accident …
I am a micro user (where CTRL-Q is the way to quit the editor) and re-mapping zellij's quit action to Alt-Q has effectively solved this annoyance for me.
Since it wasn't mentioned already, it is totally possible to remap the offending actions to keys that are more difficult to hit by accident or remove the mapping altogether:
Thanks for this idea @raphCode. I have solved my long standing issue that always bugs me.
keybinds {
unbind "Ctrl q"
}
Mhh, so should we close this? Or add a hint to the documentation?
I have tried this now and it works for me. But this is not exactly what I want.
How can I create a key binding with a combination of two keys?
I have tried this and it does not work. zellij closes as soon as I enter Ctrl-b.
keybinds {
unbind "Ctrl q"
normal {
bind "Ctrl b Ctrl q" { Quit; }
}
}
This also does not work as combination:
keybinds {
unbind "Ctrl q"
normal {
bind "Ctrl b" "Ctrl q" { Quit; }
}
}
And this gives an error message when starting zellij:
keybinds {
unbind "Ctrl q"
normal {
bind "Ctrl bq" { Quit; }
}
I've worked around it by moving the keybnding for Quit from the shared_except "locked"
section to the session
section. Now I have to do Ctrl-o
Ctrl-q
to quit.
I am new to Zellij and I already hit the ctrl-Q problem. It is too easy to press ctrl-Q, because many programs use that. And BOOM - all is lost in a second. In the zellij:status-bar all other commands need 2 key-strokes to do something. for example "SESSION":
When using ctrl-Q for Quit, it should be "normal" to show other possibilities like: "quit", "detach", "lock" or "cancel".
I mean "by default", without messing with the key bindings.
Hello there Based on @bestia-dev and @robrecord comments, what is working for me is putting the Quit option inside the session{} function/area/session after enabling the clear-defaults=true for keybinds{} and unbinding the Ctrl q combination. I'm not sure if the correct way or if there is any redundancy, but works. I'm using Zellij 0.39.2, since it started in 2022 I imagine it wasn't possible.
Changed
keybinds {
To
keybinds clear-defaults=true {
unbind "Ctrl q";
Added
bind "q" { Quit; }
To
session {
So to quit pressing Ctrl + O and then q is needed:
fyi: I created a plugin to add a confirmation prompt before killing your session: https://github.com/cristiand391/zj-quit
it's intended to replace the Quit
keybind action.