derailed / k9s

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

Use Q for quitting the app #1541

Open k8s-gpubuilder-markus opened 2 years ago

k8s-gpubuilder-markus commented 2 years ago

Could you make it possible to use q for quitting the app like it is the standard on pretty much any other Linux app?

So far I had to do CTRL C to get out of it. Quitting should be really easy and intuitive.

nublarsec commented 2 years ago

If you bring up the command palette with : you can hit q to quit. That's in line with almost all other commands that are possible within the app (see key bindings).

I think the only time they use keys without modifiers is for direct contextual actions. For instance, if you're looking at a Pod, you can do a few things:

k8s-gpubuilder-markus commented 2 years ago

Why do I have to use : ? How can this ever make sense to anybody else than a VIM user? Any app should provide a easy intuitive way to quit it, which is normally q or ESC. Intuitive as in: I don't have to RTFM to know this. In my opinion, quitting an app is an universal function that must always be available. Would you mind making k9s usable for a wider audience of users by adding the q option?

caproven commented 2 years ago

Perhaps this should be a matter of clearly documenting or otherwise advertising how to quit? I think the criticism of vim from new users is not how you quit, but rather it not communicating how to do so.

Just want to cover all options in case others agree with the command palette approach. As a heads up, you can also quit with ctrl+c.

sklirg commented 2 years ago

I just want to chime in that I also expected q to quit the app, as nothing in the default GUI told me otherwise, only attach, describe, kill etc. Nor did anything tell me about the : command palette, unless I opened "help" (which also told me how to quit it).

If q is not bound to anything currently, would it be possible to bind it to quit? Or bind a "help" function to it, to tell a user how to quit? Or if it can be a "misclick" often, maybe require confirmation (press q again to quit).

A lot of terminal tooling taking up the full terminal session supports quitting with q, such as less(1), top(1), man(1), tig(1).

I would be willing to contribute this feature if it can be accepted.

hholst80 commented 2 years ago

Any app should provide a easy intuitive way to quit it, which is normally q or ESC. I

provide examples? I do not think there is a universal method that always works. Curses application typically all have various bespoke methods and at least Vim is a well known bespoke method. ALT-F4 will not work. Lets enumerate those few applications that I still use or "recently" used.

k8s-gpubuilder-markus commented 2 years ago

One way an app can become "intuitive" is by properly documenting it, for example nano just plainly says how to exit on screen.

I see CTRL - C as a non clean way to terminate an app: most more advanced apps will not allow it, as it is mostly a convention for CLI tools to terminate them. In a GUI tool, CTRL - C will be mapped to copy (paste).

caproven commented 2 years ago

The k9s header always show the "help" shortcut which then shows how to quit (displays ":q" in the help screen). Might not be the most intuitive, but it is at least documented in the UI.

Could an entry for "quit" always displaying in the header help? Alternatively, it seems "q" is currently unbound so it could certainly bound as a dedicated "quit" key. Not sure how I feel about both "q" and ":q" being used, if "q" is added should the other be removed?

snowphone commented 8 months ago

With hotkey features, it works by adding this snippet to $HOME/.config/k9s/hotkeys.yaml: (path may differ)

hotKeys:
  quit-app:
    shortCut:    q
    description: Quit
    command:     quit
theneva commented 4 months ago

Just to add a little bit of nuance to this issue as a complete k9s noob: I expected q to close whatever thing I just opened, but not exit the entire app – like escape does now.

For example, after hitting ? to bring up Help, I intuitively tried to get back to what I was looking at by hitting q.

To me, at least, defaulting q to exit the whole app would be very unexpected.

Edit: Apparently at least some people agree with me: https://github.com/derailed/k9s/issues/832