aboutsummaryrefslogtreecommitdiff
path: root/tmux.h
diff options
context:
space:
mode:
authornicm <nicm>2020-01-27 08:53:13 +0000
committernicm <nicm>2020-01-27 08:53:13 +0000
commitd0b8d036be97efc885f879aa63ce9bbb0efd8222 (patch)
tree44cfbf25fe998698cd423eb5a88a572426929715 /tmux.h
parent2e39b621c9b29b58b4bfe761989b14f0f13d07b6 (diff)
downloadrtmux-d0b8d036be97efc885f879aa63ce9bbb0efd8222.tar.gz
rtmux-d0b8d036be97efc885f879aa63ce9bbb0efd8222.tar.bz2
rtmux-d0b8d036be97efc885f879aa63ce9bbb0efd8222.zip
Add support for adding a note to a key binding (with bind-key -N) and
use this to add descriptions to the default key bindings. A new -N flag to list-keys shows key bindings with notes rather than the default bind-key command used to create them. Change the default ? binding to use this to show a readable summary of keys. Also extend command-prompt to return the name of the key pressed and add a default binding (/) to show the note for the next key pressed Suggested by Alex Tremblay in GitHub issue 2000.
Diffstat (limited to 'tmux.h')
-rw-r--r--tmux.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/tmux.h b/tmux.h
index ac555be5..093f17a4 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1609,6 +1609,7 @@ struct client {
#define PROMPT_NUMERIC 0x2
#define PROMPT_INCREMENTAL 0x4
#define PROMPT_NOFORMAT 0x8
+#define PROMPT_KEY 0x10
int prompt_flags;
struct session *session;
@@ -1636,6 +1637,7 @@ TAILQ_HEAD(clients, client);
struct key_binding {
key_code key;
struct cmd_list *cmdlist;
+ const char *note;
int flags;
#define KEY_BINDING_REPEAT 0x1
@@ -2147,7 +2149,8 @@ void key_bindings_unref_table(struct key_table *);
struct key_binding *key_bindings_get(struct key_table *, key_code);
struct key_binding *key_bindings_first(struct key_table *);
struct key_binding *key_bindings_next(struct key_table *, struct key_binding *);
-void key_bindings_add(const char *, key_code, int, struct cmd_list *);
+void key_bindings_add(const char *, key_code, const char *, int,
+ struct cmd_list *);
void key_bindings_remove(const char *, key_code);
void key_bindings_remove_table(const char *);
void key_bindings_init(void);