zellij: Unable to send ctrl-g without rebinding in the config (one liner)
Description
With the default config I can’t seem to find a way to send Ctrl-g
to any programs I run in zellij because it’s the key to both enter and exist the locked mode.
You can send any other key that’s already used by the default config by entering the locked mode with Ctrl-g
, then hitting the key you want to send, and leaving locked mode with Ctrl-g
again, but that doesn’t work for Ctrl-g
itself.
Information
- zellij 0.6.0
- Arch Linux 5.11.16-zen1-1-zen
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 8
- Comments: 23 (11 by maintainers)
I noticed that I’m unable to send
Ctrl-g
when I tried to use it in vim to print the current file name.Some solution that come to mind are these:
Change the keybind to leave locked mode to
esc
. You can already sendesc
in normal mode, though you might want to sendesc
in locked mode without wanting to leave locked mode.If
Ctrl-g
is the first key entered in locked mode: sendCtrl-g
and leave locked mode. This behavior is similar toCtrl-b Ctrl-b
with the default tmux config, but this prevents users from leaving locked mode without sending anything if they entered it by accident.Add a keybind that sends only the next character, like
Ctrl-v
in vim’s insert mode.This is my favorite solution. I would also:
Ctrl-g
and change the current behaviour to happen withCtrl-G
(uppercaseG
). This way we can make just a minor change to the interface by changing it to<g/G> LOCK
-- INTERFACE LOCKED --
indication for the lowercase variant (the temporary one) to-- INTERFACE TEMPORARILY LOCKED --
to make it clear to the user.What do you think?
Friends, I want to stress again: we can bind/unbind/rebind any key in the config by changing one line. I changed the issue title accordingly to try and make it as clear as possible. I don’t know how to make this clearer. 😃 More info here: https://zellij.dev/documentation/keybindings.html
While I can empathize with wanting things to work just the way you like them out of the box - and I do agree we can do more in that area and indeed plan to - it takes less effort to adjust this in the config than it took me to write this comment.
This would improve on a feature that tmux has that Zellij doesn’t, the ability to pass through the prefix key.
Which in this case is an improvement over Tmux’s solution of a separate keybind just to pass through the prefix keybind.
FWIW I think this bug should be re-opened and something like https://github.com/zellij-org/zellij/issues/418#issuecomment-830019834 implemented. It was rather confusing coming across this as a new user and other multiplexers having some solution to this.
Completely agree. Many apps use control-g. In emacs it is even the most important shortcut since this might be the only key that saves you from an emacs hang up.
I think this is a very old issue and can be closed.
@vyalovvldmr - you’ll need to explicitly unbind “Ctrl g” in all modes (and hopefully bind it to something else). You can look into overriding keys here if you like: https://zellij.dev/documentation/keybindings-binding.html#overriding-keys
I just came accross the same issue: “Ctrl-g” is used to open the help screen in the nano editor. Instead of a help screen you get a lock in the terminal. “Ctrl-r” is also a nano command.
We’re definitely not alone in having this problem, and there are a number of different approaches:
The screen one will mean that my default screen bindings require me to
Ctrl+g g g
in order to sendCtrl+g
to the shell if I run zellij under screen for persistence 😄I also think that this is the best solution.