derailed / k9s

🐶 Kubernetes CLI To Manage Your Clusters In Style!
https://k9scli.io
Apache License 2.0
26.63k stars 1.67k forks source link

Alter default key-bindings #625

Open Nicholas-Autio-Mitchell opened 4 years ago

Nicholas-Autio-Mitchell commented 4 years ago




Thanks for this wonderfully useful tool!

Is your feature request related to a problem? Please describe. Some of the essential key-bindings (such as Contol-d to delete a job/pod) conflict with those used in my terminal/TMUX environment, meaning I have to always perform those in another terminal using e.g. kubectl delete pods ....

Describe the solution you'd like A way to change the default key-bindings. Looking in the documentation and skimming the source code, I haven't seen a place to do this myself. I am not talking about the hotkeys option; as far as I can tell, they are a separate feature that also shouldn't contain any of the basic key-bindings.

Describe alternatives you've considered Another YAML file where all keybindings are stored and can be overridden. I am not sure how they are currently implemented, and am not fussy about how a solution may work.

Additional context

victorboissiere commented 4 years ago

I have the same issue and I have to browse the code to override the default command: https://github.com/derailed/k9s/search?q=NewKeyAction&unscoped_q=NewKeyAction

what could be great is to generated a default hotkeys.yml so we can easily override and add custom commands

arash-bizcover commented 4 years ago

yes and everytime by default I press q

I'm dying to put q instead of Esc

dagadbm commented 4 years ago

i cant even use the tool because i use tmux ctrl-a as leader..

milj commented 2 years ago

It would be great, for example to be able to use the insert key instead of space key to select items (as in mc).

TLINDEN commented 1 year ago

It is possible to define custom key bindings in hotkey.yml. Eg:

hotKey:
  q:
    shortCut:    q
    description: exit
    command:     quit

  Delete:
    shortCut:    Delete
    description: Delete resource
    command:     delete

The first one works like a charm, but I get an error Ruroh? 'delete' command not found with the other.

It's also not possible to overwrite existing key bindings that way.

dudicoco commented 9 months ago

@derailed are there any plans on implementing this?

darthbanana13 commented 5 months ago

I found a partial workaround for people that have conflicting bindings with other applicaitons like tmux or that simply would like to use CTRL+Z to minimize K9s. Just edit a defintion with your editor, and then the k9s hotkeys are inactive. When you're done simply exit the editor without saving. It's not the best workaround, I admit.

matthewgrossman commented 4 months ago

Has anyone been successful in binding a different key to back? I have <esc> already mapped in my terminal, so I'd rather have something like q be back.

I have a hotkeys.yml like:

hotKey:
  q:
    shortCut: q
    description: Go back
    command: Back

but I get a "Ruroh?" as well for this, presumably because Back is not a valid command.