Skip to content

Conversation

@uozalp
Copy link
Contributor

@uozalp uozalp commented Nov 6, 2025

This resolves #3660
Note: PR #3650 depends on this change.

@uozalp uozalp mentioned this pull request Nov 6, 2025
@uozalp
Copy link
Contributor Author

uozalp commented Nov 16, 2025

@derailed I have resolved the merge conflicts

@derailed
Copy link
Owner

@uozalp Thank you for this cleanup! I think it looks good but for views that are k9s specific or non k8s resources we should keep the key sorts as these would not change and allow for quick sort without requiring users to column scroll
Would this make sense?

@derailed derailed added needs-tlc Pr needs additional updates in-progress Mark issue as being worked on labels Nov 16, 2025
@uozalp
Copy link
Contributor Author

uozalp commented Nov 17, 2025

@derailed Shift+S is now used for "Sort Selected Column", but several views also use Shift+S for sorting specific columns (Status, Severity).

This creates conflicts in:

Helm History, Helm Chart, Workload views (Shift+S for Status)
Image Scan view (Shift+S for Severity)

I see three options to resolve this:

  1. Assign new key bindings for Status/Severity sorts to avoid the Shift+S conflict
  2. Keep most sorts, remove only the conflicting ones (Status/Severity)
  3. Remove all sorting shortcuts from k9s-specific views and rely solely on the column cycle feature

Personally, I lean towards option 3 because:

  • These views are typically not the most frequently used
  • The column cycle feature (Shift+S) provides a universal, discoverable way to sort any column

I only use port forwards, and it often has 0-2 entries, honestly don't need to sort such small tables.

I'm happy to implement whichever approach you prefer for the project. What do you think?

Alias

Key Binding Sorts By
Shift+R Resource
Shift+C Command
Shift+A API-Group

Port Forward

Key Binding Sorts By
Shift+P Ports
Shift+U URL

Reference

Key Binding Sorts By
Shift+V GVR

Image Scan/Vulnerability

Key Binding Sorts By
Shift+L Library
Shift+S Severity
Shift+F Fixed-in
Shift+V Vulnerability

Helm History

Key Binding Sorts By
Shift+N Revision
Shift+S Status
Shift+A Age

Helm Char

Key Binding Sorts By
Shift+S Status

Workload

Key Binding Sorts By
Shift+K Kind
Shift+S Status
Shift+R Ready
Shift+A Age

Vulnerability Extender

Key Binding Sorts By
Shift+V Vulnerabilities

@derailed
Copy link
Owner

@umut Good point! I do think S for sorting might not be the best choice given a lot of k8s/crd resources do expose Status which is a natural choice. Perhaps we should shift our wording from sort to order and expose O for column sorting vs S??
Of all the k9s views, I think alias, workload and helm would benefit from direct ordering shortcuts. And we can add status along with name, namespace and age as default shortcuts...

What do you think?

@uozalp
Copy link
Contributor Author

uozalp commented Nov 17, 2025

@derailed I added shortcut bindings for the non-k8s views, changed the column-sort selection to SHIFT+O, and added SHIFT+S (sort by status) globally.
Apologies if I messed anything up. It’s easy to lose track when looking at all those shortcut bindings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in-progress Mark issue as being worked on needs-tlc Pr needs additional updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove table sorting keybindings

2 participants