Add sorting (-O flag) and a custom format (-F) to list-keys, from Dane

Jensen in GitHub issue 4845.
This commit is contained in:
nicm
2026-02-24 08:20:52 +00:00
parent 9316476a73
commit 09bd686327
7 changed files with 439 additions and 313 deletions

7
tmux.h
View File

@@ -2111,6 +2111,7 @@ struct key_binding {
key_code key;
struct cmd_list *cmdlist;
const char *note;
const char *tablename;
int flags;
#define KEY_BINDING_REPEAT 0x1
@@ -2249,6 +2250,7 @@ enum sort_order {
SORT_ACTIVITY,
SORT_CREATION,
SORT_INDEX,
SORT_MODIFIER,
SORT_NAME,
SORT_ORDER,
SORT_SIZE,
@@ -2347,6 +2349,10 @@ struct window_pane **sort_get_panes_window(struct window *, u_int *,
struct winlink **sort_get_winlinks(u_int *, struct sort_criteria *);
struct winlink **sort_get_winlinks_session(struct session *, u_int *,
struct sort_criteria *);
struct key_binding **sort_get_key_bindings(u_int *,
struct sort_criteria *);
struct key_binding **sort_get_key_bindings_table(struct key_table *,
u_int *, struct sort_criteria *);
/* format.c */
#define FORMAT_STATUS 0x1
@@ -2849,6 +2855,7 @@ void key_bindings_reset(const char *, key_code);
void key_bindings_remove_table(const char *);
void key_bindings_reset_table(const char *);
void key_bindings_init(void);
int key_bindings_has_repeat(struct key_binding **, u_int);
struct cmdq_item *key_bindings_dispatch(struct key_binding *,
struct cmdq_item *, struct client *, struct key_event *,
struct cmd_find_state *);