diff --git a/cmd-attach-session.c b/cmd-attach-session.c index 6557cef32..923229eab 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-attach-session.c,v 1.92 2026/10/02 12:48:52 nicm Exp $ */ +/* $OpenBSD: cmd-attach-session.c,v 1.93 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -35,6 +35,7 @@ static enum cmd_retval cmd_attach_session_exec(struct cmd *, const struct cmd_entry cmd_attach_session_entry = { .name = "attach-session", + .description = "Attach to an existing session.", .alias = "attach", .args = { "c:dEf:rt:x", 0, 0, NULL }, diff --git a/cmd-bind-key.c b/cmd-bind-key.c index 0d7636ff7..6d4d21a8c 100644 --- a/cmd-bind-key.c +++ b/cmd-bind-key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-bind-key.c,v 1.47 2025/04/09 07:03:04 nicm Exp $ */ +/* $OpenBSD: cmd-bind-key.c,v 1.48 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -34,6 +34,7 @@ static enum cmd_retval cmd_bind_key_exec(struct cmd *, const struct cmd_entry cmd_bind_key_entry = { .name = "bind-key", + .description = "Bind a key to one or more commands.", .alias = "bind", .args = { "nrN:T:", 1, -1, cmd_bind_key_args_parse }, diff --git a/cmd-break-pane.c b/cmd-break-pane.c index f2f1aff25..357d1c6c1 100644 --- a/cmd-break-pane.c +++ b/cmd-break-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-break-pane.c,v 1.76 2026/08/17 07:04:45 nicm Exp $ */ +/* $OpenBSD: cmd-break-pane.c,v 1.77 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -32,6 +32,7 @@ static enum cmd_retval cmd_break_pane_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_break_pane_entry = { .name = "break-pane", + .description = "Move a pane into its own window or make it floating.", .alias = "breakp", .args = { "abdPF:n:s:t:Wx:X:y:Y:", 0, 0, NULL }, diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c index 5b7c922ba..a964e8dd1 100644 --- a/cmd-capture-pane.c +++ b/cmd-capture-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-capture-pane.c,v 1.69 2026/09/08 07:31:59 nicm Exp $ */ +/* $OpenBSD: cmd-capture-pane.c,v 1.70 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Jonathan Alvarado @@ -41,6 +41,7 @@ static char *cmd_capture_pane_hyperlinks(struct grid *, struct screen *, const struct cmd_entry cmd_capture_pane_entry = { .name = "capture-pane", + .description = "Capture pane content.", .alias = "capturep", .args = { "ab:CeE:FHIJLMNpPqRS:Tt:", 0, 0, NULL }, @@ -55,6 +56,7 @@ const struct cmd_entry cmd_capture_pane_entry = { const struct cmd_entry cmd_clear_history_entry = { .name = "clear-history", + .description = "Clear a pane's history.", .alias = "clearhist", .args = { "Ht:", 0, 0, NULL }, diff --git a/cmd-choose-tree.c b/cmd-choose-tree.c index 3ca85aa14..62df6ac6c 100644 --- a/cmd-choose-tree.c +++ b/cmd-choose-tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-choose-tree.c,v 1.59 2026/10/07 13:13:49 nicm Exp $ */ +/* $OpenBSD: cmd-choose-tree.c,v 1.60 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2012 Thomas Adam @@ -31,6 +31,7 @@ static enum cmd_retval cmd_choose_tree_exec(struct cmd *, const struct cmd_entry cmd_choose_tree_entry = { .name = "choose-tree", + .description = "Browse sessions and windows interactively.", .alias = NULL, .args = { "F:f:GhK:kNO:rst:wyZ", 0, 1, cmd_choose_tree_args_parse }, @@ -45,6 +46,7 @@ const struct cmd_entry cmd_choose_tree_entry = { const struct cmd_entry cmd_choose_client_entry = { .name = "choose-client", + .description = "Choose a client interactively.", .alias = NULL, .args = { "F:f:hiK:kNO:rt:yZ", 0, 1, cmd_choose_tree_args_parse }, @@ -59,6 +61,7 @@ const struct cmd_entry cmd_choose_client_entry = { const struct cmd_entry cmd_choose_buffer_entry = { .name = "choose-buffer", + .description = "Choose a paste buffer interactively.", .alias = NULL, .args = { "F:f:K:kNO:rt:yZ", 0, 1, cmd_choose_tree_args_parse }, @@ -73,6 +76,7 @@ const struct cmd_entry cmd_choose_buffer_entry = { const struct cmd_entry cmd_customize_mode_entry = { .name = "customize-mode", + .description = "Browse and edit options and key bindings.", .alias = NULL, .args = { "F:f:kNt:yZ", 0, 0, NULL }, @@ -86,6 +90,7 @@ const struct cmd_entry cmd_customize_mode_entry = { const struct cmd_entry cmd_switch_mode_entry = { .name = "switch-mode", + .description = "Switch the active pane mode.", .alias = NULL, .args = { "F:kO:rst:wZ", 0, 1, cmd_choose_tree_args_parse }, @@ -100,6 +105,7 @@ const struct cmd_entry cmd_switch_mode_entry = { const struct cmd_entry cmd_display_panes_entry = { .name = "display-panes", + .description = "Display pane numbers.", .alias = "displayp", .args = { "d:kNs:t:Z", 0, 1, cmd_choose_tree_args_parse }, diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c index 1d135b834..1c487d818 100644 --- a/cmd-command-prompt.c +++ b/cmd-command-prompt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-command-prompt.c,v 1.76 2026/08/25 06:04:33 nicm Exp $ */ +/* $OpenBSD: cmd-command-prompt.c,v 1.77 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -40,6 +40,7 @@ static void cmd_command_prompt_free(void *); const struct cmd_entry cmd_command_prompt_entry = { .name = "command-prompt", + .description = "Open an interactive command prompt.", .alias = NULL, .args = { "1CbeFiklI:NPp:t:T:", 0, 1, cmd_command_prompt_args_parse }, diff --git a/cmd-confirm-before.c b/cmd-confirm-before.c index fda3af772..f462d27a1 100644 --- a/cmd-confirm-before.c +++ b/cmd-confirm-before.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-confirm-before.c,v 1.61 2026/06/24 10:55:39 nicm Exp $ */ +/* $OpenBSD: cmd-confirm-before.c,v 1.62 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -39,6 +39,7 @@ static void cmd_confirm_before_free(void *); const struct cmd_entry cmd_confirm_before_entry = { .name = "confirm-before", + .description = "Ask for confirmation before a command.", .alias = "confirm", .args = { "bc:p:t:y", 1, 1, cmd_confirm_before_args_parse }, diff --git a/cmd-copy-mode.c b/cmd-copy-mode.c index 28a1a742e..fd40f2ca4 100644 --- a/cmd-copy-mode.c +++ b/cmd-copy-mode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-copy-mode.c,v 1.55 2026/10/02 12:12:51 nicm Exp $ */ +/* $OpenBSD: cmd-copy-mode.c,v 1.56 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -28,6 +28,7 @@ static enum cmd_retval cmd_copy_mode_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_copy_mode_entry = { .name = "copy-mode", + .description = "Enter copy mode.", .alias = NULL, .args = { "dekHMqSs:t:u", 0, 0, NULL }, @@ -42,6 +43,7 @@ const struct cmd_entry cmd_copy_mode_entry = { const struct cmd_entry cmd_clock_mode_entry = { .name = "clock-mode", + .description = "Show a large clock in a pane.", .alias = NULL, .args = { "t:", 0, 0, NULL }, diff --git a/cmd-detach-client.c b/cmd-detach-client.c index 82ce9a00b..fe69b4bd8 100644 --- a/cmd-detach-client.c +++ b/cmd-detach-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-detach-client.c,v 1.39 2026/05/22 15:22:43 nicm Exp $ */ +/* $OpenBSD: cmd-detach-client.c,v 1.40 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -31,6 +31,7 @@ static enum cmd_retval cmd_detach_client_exec(struct cmd *, const struct cmd_entry cmd_detach_client_entry = { .name = "detach-client", + .description = "Detach one or more clients.", .alias = "detach", .args = { "aE:s:t:P", 0, 0, NULL }, @@ -45,6 +46,7 @@ const struct cmd_entry cmd_detach_client_entry = { const struct cmd_entry cmd_suspend_client_entry = { .name = "suspend-client", + .description = "Suspend a client.", .alias = "suspendc", .args = { "t:", 0, 0, NULL }, diff --git a/cmd-display-menu.c b/cmd-display-menu.c index a73537584..83e0da934 100644 --- a/cmd-display-menu.c +++ b/cmd-display-menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-display-menu.c,v 1.55 2026/09/21 12:14:32 nicm Exp $ */ +/* $OpenBSD: cmd-display-menu.c,v 1.56 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott @@ -37,6 +37,7 @@ static enum cmd_retval cmd_display_popup_exec(struct cmd *, const struct cmd_entry cmd_display_menu_entry = { .name = "display-menu", + .description = "Display an interactive menu.", .alias = "menu", .args = { "b:c:C:H:s:S:MOt:T:x:y:", 1, -1, cmd_display_menu_args_parse }, @@ -53,6 +54,7 @@ const struct cmd_entry cmd_display_menu_entry = { const struct cmd_entry cmd_display_popup_entry = { .name = "display-popup", + .description = "Create a floating pane (compatibility command).", .alias = "popup", .args = { "Bb:Cc:d:e:Eh:ks:S:t:T:w:x:y:", 0, -1, NULL }, diff --git a/cmd-display-message.c b/cmd-display-message.c index ca56574f7..fe6d70bc6 100644 --- a/cmd-display-message.c +++ b/cmd-display-message.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-display-message.c,v 1.67 2026/10/02 15:13:07 nicm Exp $ */ +/* $OpenBSD: cmd-display-message.c,v 1.68 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -37,6 +37,7 @@ static enum cmd_retval cmd_display_message_exec(struct cmd *, const struct cmd_entry cmd_display_message_entry = { .name = "display-message", + .description = "Display a message or expand formats.", .alias = "display", .args = { "aCc:d:jlINpt:F:v", 0, 1, NULL }, diff --git a/cmd-find-window.c b/cmd-find-window.c index 0091ae907..9239f89b3 100644 --- a/cmd-find-window.c +++ b/cmd-find-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-find-window.c,v 1.57 2026/07/14 17:17:17 nicm Exp $ */ +/* $OpenBSD: cmd-find-window.c,v 1.58 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -30,6 +30,7 @@ static enum cmd_retval cmd_find_window_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_find_window_entry = { .name = "find-window", + .description = "Find windows by content or name.", .alias = "findw", .args = { "CiNrt:TZ", 1, 1, NULL }, diff --git a/cmd-if-shell.c b/cmd-if-shell.c index 59d34f9d6..cafbde877 100644 --- a/cmd-if-shell.c +++ b/cmd-if-shell.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-if-shell.c,v 1.87 2026/08/25 06:04:33 nicm Exp $ */ +/* $OpenBSD: cmd-if-shell.c,v 1.88 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -40,6 +40,7 @@ static void cmd_if_shell_free(void *); const struct cmd_entry cmd_if_shell_entry = { .name = "if-shell", + .description = "Run a command conditionally.", .alias = "if", .args = { "bFt:", 2, 3, cmd_if_shell_args_parse }, diff --git a/cmd-join-pane.c b/cmd-join-pane.c index 4bc03b5d2..91880060d 100644 --- a/cmd-join-pane.c +++ b/cmd-join-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-join-pane.c,v 1.77 2026/10/07 12:02:21 nicm Exp $ */ +/* $OpenBSD: cmd-join-pane.c,v 1.78 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2011 George Nachman @@ -37,6 +37,7 @@ static void cmd_join_pane_mouse_move(struct client *, const struct cmd_entry cmd_join_pane_entry = { .name = "join-pane", + .description = "Move a pane into another window.", .alias = "joinp", .args = { "bdfhvp:l:s:t:", 0, 0, NULL }, @@ -51,6 +52,7 @@ const struct cmd_entry cmd_join_pane_entry = { const struct cmd_entry cmd_move_pane_entry = { .name = "move-pane", + .description = "Move a pane or reposition a floating pane.", .alias = "movep", .args = { "bdD::fhMvl:L::P:R::s:t:U::X:Y:z:", 0, 0, NULL }, diff --git a/cmd-kill-pane.c b/cmd-kill-pane.c index f634a7cd7..bd842cbc3 100644 --- a/cmd-kill-pane.c +++ b/cmd-kill-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-kill-pane.c,v 1.34 2026/06/09 21:22:22 nicm Exp $ */ +/* $OpenBSD: cmd-kill-pane.c,v 1.35 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -34,6 +34,7 @@ static int cmd_kill_pane_filter(struct cmdq_item *, const struct cmd_entry cmd_kill_pane_entry = { .name = "kill-pane", + .description = "Destroy one or more panes.", .alias = "killp", .args = { "af:t:", 0, 0, NULL }, diff --git a/cmd-kill-server.c b/cmd-kill-server.c index 8b70be3d8..d0d94e782 100644 --- a/cmd-kill-server.c +++ b/cmd-kill-server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-kill-server.c,v 1.20 2021/08/21 10:22:39 nicm Exp $ */ +/* $OpenBSD: cmd-kill-server.c,v 1.21 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -31,6 +31,7 @@ static enum cmd_retval cmd_kill_server_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_kill_server_entry = { .name = "kill-server", + .description = "Stop the tmux server.", .alias = NULL, .args = { "", 0, 0, NULL }, @@ -42,6 +43,7 @@ const struct cmd_entry cmd_kill_server_entry = { const struct cmd_entry cmd_start_server_entry = { .name = "start-server", + .description = "Start the tmux server.", .alias = "start", .args = { "", 0, 0, NULL }, diff --git a/cmd-kill-session.c b/cmd-kill-session.c index 7edd2a30a..031066c8a 100644 --- a/cmd-kill-session.c +++ b/cmd-kill-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-kill-session.c,v 1.31 2026/06/09 12:57:40 nicm Exp $ */ +/* $OpenBSD: cmd-kill-session.c,v 1.32 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -36,6 +36,7 @@ static int cmd_kill_session_filter(struct cmdq_item *, const struct cmd_entry cmd_kill_session_entry = { .name = "kill-session", + .description = "Destroy one or more sessions.", .alias = NULL, .args = { "aCgf:t:", 0, 0, NULL }, diff --git a/cmd-kill-window.c b/cmd-kill-window.c index e7a6ec32e..242c7b4f1 100644 --- a/cmd-kill-window.c +++ b/cmd-kill-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-kill-window.c,v 1.30 2026/06/09 12:57:40 nicm Exp $ */ +/* $OpenBSD: cmd-kill-window.c,v 1.31 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -33,6 +33,7 @@ static int cmd_kill_window_filter(struct cmdq_item *, const struct cmd_entry cmd_kill_window_entry = { .name = "kill-window", + .description = "Destroy one or more windows.", .alias = "killw", .args = { "af:t:", 0, 0, NULL }, @@ -46,6 +47,7 @@ const struct cmd_entry cmd_kill_window_entry = { const struct cmd_entry cmd_unlink_window_entry = { .name = "unlink-window", + .description = "Unlink a window from a session.", .alias = "unlinkw", .args = { "kt:", 0, 0, NULL }, diff --git a/cmd-list-buffers.c b/cmd-list-buffers.c index 82ee58947..cbb7a2429 100644 --- a/cmd-list-buffers.c +++ b/cmd-list-buffers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-list-buffers.c,v 1.41 2026/02/27 08:25:12 nicm Exp $ */ +/* $OpenBSD: cmd-list-buffers.c,v 1.42 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -34,6 +34,7 @@ static enum cmd_retval cmd_list_buffers_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_list_buffers_entry = { .name = "list-buffers", + .description = "List paste buffers.", .alias = "lsb", .args = { "F:f:O:r", 0, 0, NULL }, diff --git a/cmd-list-clients.c b/cmd-list-clients.c index 77f3912ca..aef752d58 100644 --- a/cmd-list-clients.c +++ b/cmd-list-clients.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-list-clients.c,v 1.42 2026/02/27 08:25:12 nicm Exp $ */ +/* $OpenBSD: cmd-list-clients.c,v 1.43 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -39,6 +39,7 @@ static enum cmd_retval cmd_list_clients_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_list_clients_entry = { .name = "list-clients", + .description = "List connected clients.", .alias = "lsc", .args = { "F:f:O:rt:", 0, 0, NULL }, diff --git a/cmd-list-commands.c b/cmd-list-commands.c index 5e9c4430c..b68386013 100644 --- a/cmd-list-commands.c +++ b/cmd-list-commands.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-list-commands.c,v 1.15 2026/02/24 08:22:13 nicm Exp $ */ +/* $OpenBSD: cmd-list-commands.c,v 1.16 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -31,20 +31,43 @@ "#{command_list_name}" \ "#{?command_list_alias, (#{command_list_alias}),} " \ "#{command_list_usage}" +#define LIST_COMMANDS_HELP_TEMPLATE \ + "#{p|#{command_list_name_width}:command_list_name} " \ + "#{command_list_description}" +#define LIST_COMMANDS_VERBOSE_TEMPLATE \ + LIST_COMMANDS_TEMPLATE "\n #{command_list_description}" static enum cmd_retval cmd_list_commands(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_list_commands_entry = { .name = "list-commands", + .description = "List commands or show command syntax.", .alias = "lscm", - .args = { "F:", 0, 1, NULL }, - .usage = "[-F format] [command]", + .args = { "F:h", 0, 1, NULL }, + .usage = "[-h] [-F format] [command]", .flags = CMD_STARTSERVER|CMD_AFTERHOOK, .exec = cmd_list_commands }; +static u_int +cmd_list_commands_get_width(const struct cmd_entry *only) +{ + const struct cmd_entry **entryp; + u_int width, largest = 0; + + if (only != NULL) + return (utf8_cstrwidth(only->name)); + + for (entryp = cmd_table; *entryp != NULL; entryp++) { + width = utf8_cstrwidth((*entryp)->name); + if (width > largest) + largest = width; + } + return (largest); +} + static void cmd_list_single_command(const struct cmd_entry *entry, struct format_tree *ft, const char *template, struct cmdq_item *item) @@ -63,6 +86,11 @@ cmd_list_single_command(const struct cmd_entry *entry, struct format_tree *ft, else s = ""; format_add(ft, "command_list_usage", "%s", s); + if (entry->description != NULL) + s = entry->description; + else + s = ""; + format_add(ft, "command_list_description", "%s", s); line = format_expand(ft, template); if (*line != '\0') @@ -75,33 +103,44 @@ cmd_list_commands(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); const struct cmd_entry **entryp; - const struct cmd_entry *entry; + const struct cmd_entry *entry = NULL; struct format_tree *ft; const char *template, *command; char *cause; + int help; + u_int width; - if ((template = args_get(args, 'F')) == NULL) - template = LIST_COMMANDS_TEMPLATE; - - ft = format_create(cmdq_get_client(item), item, FORMAT_NONE, 0); - format_defaults(ft, NULL, NULL, NULL, NULL); + if ((template = args_get(args, 'F')) == NULL) { + help = args_has(args, 'h'); + if (help > 1) + template = LIST_COMMANDS_VERBOSE_TEMPLATE; + else if (help == 1) + template = LIST_COMMANDS_HELP_TEMPLATE; + else + template = LIST_COMMANDS_TEMPLATE; + } command = args_string(args, 0); - if (command == NULL) { - for (entryp = cmd_table; *entryp != NULL; entryp++) - cmd_list_single_command(*entryp, ft, template, item); - } else { + if (command != NULL) { entry = cmd_find(command, &cause); - if (entry != NULL) - cmd_list_single_command(entry, ft, template, item); - else { + if (entry == NULL) { cmdq_error(item, "%s", cause); free(cause); - format_free(ft); return (CMD_RETURN_ERROR); } } + ft = format_create(cmdq_get_client(item), item, FORMAT_NONE, 0); + format_defaults(ft, NULL, NULL, NULL, NULL); + width = cmd_list_commands_get_width(entry); + format_add(ft, "command_list_name_width", "%u", width); + + if (entry == NULL) { + for (entryp = cmd_table; *entryp != NULL; entryp++) + cmd_list_single_command(*entryp, ft, template, item); + } else + cmd_list_single_command(entry, ft, template, item); + format_free(ft); return (CMD_RETURN_NORMAL); } diff --git a/cmd-list-keys.c b/cmd-list-keys.c index e8617c2e3..ccaa4a0f9 100644 --- a/cmd-list-keys.c +++ b/cmd-list-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-list-keys.c,v 1.78 2026/07/01 13:12:17 nicm Exp $ */ +/* $OpenBSD: cmd-list-keys.c,v 1.79 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -42,6 +42,7 @@ static enum cmd_retval cmd_list_keys_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_list_keys_entry = { .name = "list-keys", + .description = "List key bindings.", .alias = "lsk", .args = { "1aF:NO:P:rT:", 0, 1, NULL }, diff --git a/cmd-list-panes.c b/cmd-list-panes.c index 5bc996c2f..412679c4d 100644 --- a/cmd-list-panes.c +++ b/cmd-list-panes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-list-panes.c,v 1.41 2026/09/08 10:20:08 nicm Exp $ */ +/* $OpenBSD: cmd-list-panes.c,v 1.42 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -36,6 +36,7 @@ static void cmd_list_panes_window(struct cmd *, struct session *, const struct cmd_entry cmd_list_panes_entry = { .name = "list-panes", + .description = "List panes and their state.", .alias = "lsp", .args = { "aF:f:O:rst:", 0, 0, NULL }, diff --git a/cmd-list-sessions.c b/cmd-list-sessions.c index 30f2178ad..87e7106ed 100644 --- a/cmd-list-sessions.c +++ b/cmd-list-sessions.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-list-sessions.c,v 1.37 2026/09/08 10:20:08 nicm Exp $ */ +/* $OpenBSD: cmd-list-sessions.c,v 1.38 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -40,6 +40,7 @@ static enum cmd_retval cmd_list_sessions_exec(struct cmd *, const struct cmd_entry cmd_list_sessions_entry = { .name = "list-sessions", + .description = "List sessions and their state.", .alias = "ls", .args = { "F:f:O:r", 0, 0, NULL }, diff --git a/cmd-list-windows.c b/cmd-list-windows.c index 2cbccc1b8..1f49a1f17 100644 --- a/cmd-list-windows.c +++ b/cmd-list-windows.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-list-windows.c,v 1.51 2026/09/08 10:20:08 nicm Exp $ */ +/* $OpenBSD: cmd-list-windows.c,v 1.52 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -43,6 +43,7 @@ static enum cmd_retval cmd_list_windows_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_list_windows_entry = { .name = "list-windows", + .description = "List windows and their state.", .alias = "lsw", .args = { "aF:f:O:rt:", 0, 0, NULL }, diff --git a/cmd-load-buffer.c b/cmd-load-buffer.c index e9b016071..96cc4e62e 100644 --- a/cmd-load-buffer.c +++ b/cmd-load-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-load-buffer.c,v 1.67 2026/10/08 07:06:26 nicm Exp $ */ +/* $OpenBSD: cmd-load-buffer.c,v 1.68 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -35,6 +35,7 @@ static enum cmd_retval cmd_load_buffer_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_load_buffer_entry = { .name = "load-buffer", + .description = "Load a file into a paste buffer.", .alias = "loadb", .args = { "b:t:w", 1, 1, NULL }, diff --git a/cmd-lock-server.c b/cmd-lock-server.c index 1feac03f8..ce7c69078 100644 --- a/cmd-lock-server.c +++ b/cmd-lock-server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-lock-server.c,v 1.31 2021/08/21 10:22:39 nicm Exp $ */ +/* $OpenBSD: cmd-lock-server.c,v 1.32 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -28,6 +28,7 @@ static enum cmd_retval cmd_lock_server_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_lock_server_entry = { .name = "lock-server", + .description = "Lock every client.", .alias = "lock", .args = { "", 0, 0, NULL }, @@ -39,6 +40,7 @@ const struct cmd_entry cmd_lock_server_entry = { const struct cmd_entry cmd_lock_session_entry = { .name = "lock-session", + .description = "Lock every client attached to a session.", .alias = "locks", .args = { "t:", 0, 0, NULL }, @@ -52,6 +54,7 @@ const struct cmd_entry cmd_lock_session_entry = { const struct cmd_entry cmd_lock_client_entry = { .name = "lock-client", + .description = "Lock a client.", .alias = "lockc", .args = { "t:", 0, 0, NULL }, diff --git a/cmd-move-window.c b/cmd-move-window.c index 1cd4f10a8..a8f1383c9 100644 --- a/cmd-move-window.c +++ b/cmd-move-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-move-window.c,v 1.34 2021/08/21 10:22:39 nicm Exp $ */ +/* $OpenBSD: cmd-move-window.c,v 1.35 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -30,6 +30,7 @@ static enum cmd_retval cmd_move_window_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_move_window_entry = { .name = "move-window", + .description = "Move a window between sessions.", .alias = "movew", .args = { "abdkrs:t:", 0, 0, NULL }, @@ -44,6 +45,7 @@ const struct cmd_entry cmd_move_window_entry = { const struct cmd_entry cmd_link_window_entry = { .name = "link-window", + .description = "Link a window into another session.", .alias = "linkw", .args = { "abdks:t:", 0, 0, NULL }, diff --git a/cmd-new-session.c b/cmd-new-session.c index 56d4f9779..7f7643bfe 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-session.c,v 1.152 2026/07/10 13:38:45 nicm Exp $ */ +/* $OpenBSD: cmd-new-session.c,v 1.153 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -37,6 +37,7 @@ static enum cmd_retval cmd_new_session_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_new_session_entry = { .name = "new-session", + .description = "Create a new session.", .alias = "new", .args = { "Ac:dDe:EF:f:n:Ps:t:x:Xy:", 0, -1, NULL }, @@ -53,6 +54,7 @@ const struct cmd_entry cmd_new_session_entry = { const struct cmd_entry cmd_has_session_entry = { .name = "has-session", + .description = "Check whether a session exists.", .alias = "has", .args = { "t:", 0, 0, NULL }, diff --git a/cmd-new-window.c b/cmd-new-window.c index 6ec55fe64..60000a67d 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-window.c,v 1.104 2026/09/03 21:04:11 nicm Exp $ */ +/* $OpenBSD: cmd-new-window.c,v 1.105 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -36,6 +36,7 @@ static enum cmd_retval cmd_new_window_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_new_window_entry = { .name = "new-window", + .description = "Create a window.", .alias = "neww", .args = { "abc:de:EF:kn:PSt:", 0, -1, NULL }, diff --git a/cmd-paste-buffer.c b/cmd-paste-buffer.c index fbe598b04..d2355c74e 100644 --- a/cmd-paste-buffer.c +++ b/cmd-paste-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-paste-buffer.c,v 1.44 2026/03/04 07:19:32 tb Exp $ */ +/* $OpenBSD: cmd-paste-buffer.c,v 1.45 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -32,6 +32,7 @@ static enum cmd_retval cmd_paste_buffer_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_paste_buffer_entry = { .name = "paste-buffer", + .description = "Paste a buffer into a pane.", .alias = "pasteb", .args = { "db:prSs:t:", 0, 0, NULL }, diff --git a/cmd-pipe-pane.c b/cmd-pipe-pane.c index 9e04b478b..beb22df2e 100644 --- a/cmd-pipe-pane.c +++ b/cmd-pipe-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-pipe-pane.c,v 1.64 2026/07/27 14:25:46 nicm Exp $ */ +/* $OpenBSD: cmd-pipe-pane.c,v 1.65 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -42,6 +42,7 @@ static void cmd_pipe_pane_error_callback(struct bufferevent *, short, void *); const struct cmd_entry cmd_pipe_pane_entry = { .name = "pipe-pane", + .description = "Pipe pane input or output to a command.", .alias = "pipep", .args = { "IOot:", 0, 1, NULL }, diff --git a/cmd-refresh-client.c b/cmd-refresh-client.c index 11b43bf22..cd631e914 100644 --- a/cmd-refresh-client.c +++ b/cmd-refresh-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-refresh-client.c,v 1.55 2026/07/17 08:37:29 nicm Exp $ */ +/* $OpenBSD: cmd-refresh-client.c,v 1.56 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -32,6 +32,7 @@ static enum cmd_retval cmd_refresh_client_exec(struct cmd *, const struct cmd_entry cmd_refresh_client_entry = { .name = "refresh-client", + .description = "Refresh or resize a client.", .alias = "refresh", .args = { "A:B:cC:Df:r:F:lLRSt:U", 0, 1, NULL }, diff --git a/cmd-rename-session.c b/cmd-rename-session.c index 35719c564..d11bccc12 100644 --- a/cmd-rename-session.c +++ b/cmd-rename-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-rename-session.c,v 1.39 2026/07/10 13:38:45 nicm Exp $ */ +/* $OpenBSD: cmd-rename-session.c,v 1.40 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -32,6 +32,7 @@ static enum cmd_retval cmd_rename_session_exec(struct cmd *, const struct cmd_entry cmd_rename_session_entry = { .name = "rename-session", + .description = "Rename a session.", .alias = "rename", .args = { "t:", 1, 1, NULL }, diff --git a/cmd-rename-window.c b/cmd-rename-window.c index f55f8a18f..2cb7bf265 100644 --- a/cmd-rename-window.c +++ b/cmd-rename-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-rename-window.c,v 1.30 2026/06/29 18:17:28 nicm Exp $ */ +/* $OpenBSD: cmd-rename-window.c,v 1.31 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -31,6 +31,7 @@ static enum cmd_retval cmd_rename_window_exec(struct cmd *, const struct cmd_entry cmd_rename_window_entry = { .name = "rename-window", + .description = "Rename a window.", .alias = "renamew", .args = { "t:", 1, 1, NULL }, diff --git a/cmd-resize-pane.c b/cmd-resize-pane.c index 90ebff4c1..9096563f9 100644 --- a/cmd-resize-pane.c +++ b/cmd-resize-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-resize-pane.c,v 1.70 2026/10/02 12:48:52 nicm Exp $ */ +/* $OpenBSD: cmd-resize-pane.c,v 1.71 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -39,6 +39,7 @@ static void cmd_resize_pane_mouse_resize_tiled(struct client *, const struct cmd_entry cmd_resize_pane_entry = { .name = "resize-pane", + .description = "Resize or zoom a pane.", .alias = "resizep", .args = { "D::L::MR::Tt:U::x:y:Z", 0, 1, NULL }, diff --git a/cmd-resize-window.c b/cmd-resize-window.c index a89750607..6b5b5522a 100644 --- a/cmd-resize-window.c +++ b/cmd-resize-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-resize-window.c,v 1.10 2023/06/30 13:19:32 nicm Exp $ */ +/* $OpenBSD: cmd-resize-window.c,v 1.11 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2018 Nicholas Marriott @@ -31,6 +31,7 @@ static enum cmd_retval cmd_resize_window_exec(struct cmd *, const struct cmd_entry cmd_resize_window_entry = { .name = "resize-window", + .description = "Resize a window.", .alias = "resizew", .args = { "aADLRt:Ux:y:", 0, 1, NULL }, diff --git a/cmd-respawn-pane.c b/cmd-respawn-pane.c index 66a5a0be4..bc7ff4e7c 100644 --- a/cmd-respawn-pane.c +++ b/cmd-respawn-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-respawn-pane.c,v 1.40 2026/07/03 16:09:49 nicm Exp $ */ +/* $OpenBSD: cmd-respawn-pane.c,v 1.41 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -32,6 +32,7 @@ static enum cmd_retval cmd_respawn_pane_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_respawn_pane_entry = { .name = "respawn-pane", + .description = "Restart a pane's command.", .alias = "respawnp", .args = { "c:e:Ekt:", 0, -1, NULL }, diff --git a/cmd-respawn-window.c b/cmd-respawn-window.c index e10469649..246b0de0d 100644 --- a/cmd-respawn-window.c +++ b/cmd-respawn-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-respawn-window.c,v 1.51 2026/07/03 16:09:49 nicm Exp $ */ +/* $OpenBSD: cmd-respawn-window.c,v 1.52 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -32,6 +32,7 @@ static enum cmd_retval cmd_respawn_window_exec(struct cmd *, const struct cmd_entry cmd_respawn_window_entry = { .name = "respawn-window", + .description = "Restart every pane in a window.", .alias = "respawnw", .args = { "c:e:Ekt:", 0, -1, NULL }, diff --git a/cmd-rotate-window.c b/cmd-rotate-window.c index d62fd0fa4..27d17ee3b 100644 --- a/cmd-rotate-window.c +++ b/cmd-rotate-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-rotate-window.c,v 1.34 2026/06/22 08:47:45 nicm Exp $ */ +/* $OpenBSD: cmd-rotate-window.c,v 1.35 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -29,6 +29,7 @@ static enum cmd_retval cmd_rotate_window_exec(struct cmd *, const struct cmd_entry cmd_rotate_window_entry = { .name = "rotate-window", + .description = "Rotate panes in a window.", .alias = "rotatew", .args = { "Dt:UZ", 0, 0, NULL }, diff --git a/cmd-run-shell.c b/cmd-run-shell.c index 4834cd9f7..029a76155 100644 --- a/cmd-run-shell.c +++ b/cmd-run-shell.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-run-shell.c,v 1.95 2026/09/20 07:59:55 nicm Exp $ */ +/* $OpenBSD: cmd-run-shell.c,v 1.96 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -42,6 +42,7 @@ static void cmd_run_shell_print(struct job *, const char *); const struct cmd_entry cmd_run_shell_entry = { .name = "run-shell", + .description = "Run a shell command.", .alias = "run", .args = { "bd:Ct:Es:c:", 0, -1, cmd_run_shell_args_parse }, diff --git a/cmd-save-buffer.c b/cmd-save-buffer.c index 903016c5d..5ad51a49c 100644 --- a/cmd-save-buffer.c +++ b/cmd-save-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-save-buffer.c,v 1.57 2025/10/28 07:32:26 nicm Exp $ */ +/* $OpenBSD: cmd-save-buffer.c,v 1.58 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -36,6 +36,7 @@ static enum cmd_retval cmd_save_buffer_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_save_buffer_entry = { .name = "save-buffer", + .description = "Save a paste buffer to a file.", .alias = "saveb", .args = { "ab:", 1, 1, NULL }, @@ -47,6 +48,7 @@ const struct cmd_entry cmd_save_buffer_entry = { const struct cmd_entry cmd_show_buffer_entry = { .name = "show-buffer", + .description = "Print a paste buffer.", .alias = "showb", .args = { "b:", 0, 0, NULL }, diff --git a/cmd-select-layout.c b/cmd-select-layout.c index 95f60e6ca..9e9e02e5d 100644 --- a/cmd-select-layout.c +++ b/cmd-select-layout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-select-layout.c,v 1.45 2026/09/09 07:03:39 nicm Exp $ */ +/* $OpenBSD: cmd-select-layout.c,v 1.46 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -31,6 +31,7 @@ static enum cmd_retval cmd_select_layout_exec(struct cmd *, const struct cmd_entry cmd_select_layout_entry = { .name = "select-layout", + .description = "Choose or apply a layout.", .alias = "selectl", .args = { "Enopt:", 0, 1, NULL }, @@ -44,6 +45,7 @@ const struct cmd_entry cmd_select_layout_entry = { const struct cmd_entry cmd_next_layout_entry = { .name = "next-layout", + .description = "Select the next layout.", .alias = "nextl", .args = { "t:", 0, 0, NULL }, @@ -57,6 +59,7 @@ const struct cmd_entry cmd_next_layout_entry = { const struct cmd_entry cmd_previous_layout_entry = { .name = "previous-layout", + .description = "Select the previous layout.", .alias = "prevl", .args = { "t:", 0, 0, NULL }, diff --git a/cmd-select-pane.c b/cmd-select-pane.c index e23ca0adc..c51e4ea31 100644 --- a/cmd-select-pane.c +++ b/cmd-select-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-select-pane.c,v 1.78 2026/08/20 09:19:24 nicm Exp $ */ +/* $OpenBSD: cmd-select-pane.c,v 1.79 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -31,6 +31,7 @@ static enum cmd_retval cmd_select_pane_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_select_pane_entry = { .name = "select-pane", + .description = "Select or mark a pane.", .alias = "selectp", .args = { "DdegLlMmP:RT:t:UZ", 0, 0, NULL }, /* -P and -g deprecated */ @@ -44,6 +45,7 @@ const struct cmd_entry cmd_select_pane_entry = { const struct cmd_entry cmd_last_pane_entry = { .name = "last-pane", + .description = "Select the previously active pane.", .alias = "lastp", .args = { "det:Z", 0, 0, NULL }, diff --git a/cmd-select-window.c b/cmd-select-window.c index 32b4821bf..1e0c89a87 100644 --- a/cmd-select-window.c +++ b/cmd-select-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-select-window.c,v 1.30 2021/08/21 10:22:39 nicm Exp $ */ +/* $OpenBSD: cmd-select-window.c,v 1.31 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -31,6 +31,7 @@ static enum cmd_retval cmd_select_window_exec(struct cmd *, const struct cmd_entry cmd_select_window_entry = { .name = "select-window", + .description = "Select a window.", .alias = "selectw", .args = { "lnpTt:", 0, 0, NULL }, @@ -44,6 +45,7 @@ const struct cmd_entry cmd_select_window_entry = { const struct cmd_entry cmd_next_window_entry = { .name = "next-window", + .description = "Select the next window.", .alias = "next", .args = { "at:", 0, 0, NULL }, @@ -57,6 +59,7 @@ const struct cmd_entry cmd_next_window_entry = { const struct cmd_entry cmd_previous_window_entry = { .name = "previous-window", + .description = "Select the previous window.", .alias = "prev", .args = { "at:", 0, 0, NULL }, @@ -70,6 +73,7 @@ const struct cmd_entry cmd_previous_window_entry = { const struct cmd_entry cmd_last_window_entry = { .name = "last-window", + .description = "Select the previously active window.", .alias = "last", .args = { "t:", 0, 0, NULL }, diff --git a/cmd-send-keys.c b/cmd-send-keys.c index 06043bddb..f9f0360e4 100644 --- a/cmd-send-keys.c +++ b/cmd-send-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-send-keys.c,v 1.81 2026/06/11 19:13:34 nicm Exp $ */ +/* $OpenBSD: cmd-send-keys.c,v 1.82 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -31,6 +31,7 @@ static enum cmd_retval cmd_send_keys_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_send_keys_entry = { .name = "send-keys", + .description = "Send keys to a pane or client.", .alias = "send", .args = { "c:FHKlMN:Rt:X", 0, -1, NULL }, @@ -46,6 +47,7 @@ const struct cmd_entry cmd_send_keys_entry = { const struct cmd_entry cmd_send_prefix_entry = { .name = "send-prefix", + .description = "Send the prefix key to a pane.", .alias = NULL, .args = { "2t:", 0, 0, NULL }, diff --git a/cmd-server-access.c b/cmd-server-access.c index e85a278a8..1f07c7214 100644 --- a/cmd-server-access.c +++ b/cmd-server-access.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-server-access.c,v 1.6 2026/06/09 12:58:40 nicm Exp $ */ +/* $OpenBSD: cmd-server-access.c,v 1.7 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2021 Dallas Lyons @@ -36,6 +36,7 @@ static enum cmd_retval cmd_server_access_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_server_access_entry = { .name = "server-access", + .description = "Manage access to the tmux server.", .alias = NULL, .args = { "adglrw", 0, 1, NULL }, diff --git a/cmd-set-buffer.c b/cmd-set-buffer.c index 3e540f706..e57a8ae6c 100644 --- a/cmd-set-buffer.c +++ b/cmd-set-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-set-buffer.c,v 1.38 2026/08/24 07:05:23 nicm Exp $ */ +/* $OpenBSD: cmd-set-buffer.c,v 1.39 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -31,6 +31,7 @@ static enum cmd_retval cmd_set_buffer_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_set_buffer_entry = { .name = "set-buffer", + .description = "Create or modify a paste buffer.", .alias = "setb", .args = { "ab:t:n:w", 0, 1, NULL }, @@ -43,6 +44,7 @@ const struct cmd_entry cmd_set_buffer_entry = { const struct cmd_entry cmd_delete_buffer_entry = { .name = "delete-buffer", + .description = "Delete a paste buffer.", .alias = "deleteb", .args = { "b:", 0, 0, NULL }, diff --git a/cmd-set-environment.c b/cmd-set-environment.c index 9a6552cb5..d15ccdec5 100644 --- a/cmd-set-environment.c +++ b/cmd-set-environment.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-set-environment.c,v 1.29 2025/04/09 06:27:43 nicm Exp $ */ +/* $OpenBSD: cmd-set-environment.c,v 1.30 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -32,6 +32,7 @@ static enum cmd_retval cmd_set_environment_exec(struct cmd *, const struct cmd_entry cmd_set_environment_entry = { .name = "set-environment", + .description = "Set or remove an environment variable.", .alias = "setenv", .args = { "Fhgrt:u", 1, 2, NULL }, diff --git a/cmd-set-option.c b/cmd-set-option.c index 335a54760..3db645e24 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-set-option.c,v 1.146 2026/07/10 15:20:06 nicm Exp $ */ +/* $OpenBSD: cmd-set-option.c,v 1.147 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -38,6 +38,7 @@ static enum cmd_retval cmd_set_hook_monitor_exec(struct cmdq_item *, const struct cmd_entry cmd_set_option_entry = { .name = "set-option", + .description = "Set a server, session, or pane option.", .alias = "set", .args = { "aFgopqst:uUw", 1, 2, cmd_set_option_args_parse }, @@ -51,6 +52,7 @@ const struct cmd_entry cmd_set_option_entry = { const struct cmd_entry cmd_set_window_option_entry = { .name = "set-window-option", + .description = "Set a window option.", .alias = "setw", .args = { "aFgoqt:u", 1, 2, cmd_set_option_args_parse }, @@ -64,6 +66,7 @@ const struct cmd_entry cmd_set_window_option_entry = { const struct cmd_entry cmd_set_hook_entry = { .name = "set-hook", + .description = "Set or remove a hook.", .alias = NULL, .args = { "agpERTt:uB:w", 0, 2, cmd_set_option_args_parse }, diff --git a/cmd-show-environment.c b/cmd-show-environment.c index 692f09c32..d7757e0df 100644 --- a/cmd-show-environment.c +++ b/cmd-show-environment.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-show-environment.c,v 1.29 2025/04/09 06:27:43 nicm Exp $ */ +/* $OpenBSD: cmd-show-environment.c,v 1.30 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -36,6 +36,7 @@ static void cmd_show_environment_print(struct cmd *, struct cmdq_item *, const struct cmd_entry cmd_show_environment_entry = { .name = "show-environment", + .description = "Show environment variables.", .alias = "showenv", .args = { "hgst:", 0, 1, NULL }, diff --git a/cmd-show-messages.c b/cmd-show-messages.c index f9e198c4c..2ed337d26 100644 --- a/cmd-show-messages.c +++ b/cmd-show-messages.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-show-messages.c,v 1.37 2025/11/18 08:37:54 nicm Exp $ */ +/* $OpenBSD: cmd-show-messages.c,v 1.38 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -38,6 +38,7 @@ static enum cmd_retval cmd_show_messages_exec(struct cmd *, const struct cmd_entry cmd_show_messages_entry = { .name = "show-messages", + .description = "Show server and client messages.", .alias = "showmsgs", .args = { "JTt:", 0, 0, NULL }, diff --git a/cmd-show-options.c b/cmd-show-options.c index 910aaf348..5c3a7113d 100644 --- a/cmd-show-options.c +++ b/cmd-show-options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-show-options.c,v 1.76 2026/07/27 19:15:58 nicm Exp $ */ +/* $OpenBSD: cmd-show-options.c,v 1.77 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -50,6 +50,7 @@ static enum cmd_retval cmd_show_options_all(struct cmd *, struct cmdq_item *, const struct cmd_entry cmd_show_options_entry = { .name = "show-options", + .description = "Show server, session, or pane options.", .alias = "show", .args = { "AgF:Hpqst:vw", 0, 1, NULL }, @@ -63,6 +64,7 @@ const struct cmd_entry cmd_show_options_entry = { const struct cmd_entry cmd_show_window_options_entry = { .name = "show-window-options", + .description = "Show window options.", .alias = "showw", .args = { "F:gvt:", 0, 1, NULL }, @@ -76,6 +78,7 @@ const struct cmd_entry cmd_show_window_options_entry = { const struct cmd_entry cmd_show_hooks_entry = { .name = "show-hooks", + .description = "Show hooks.", .alias = NULL, .args = { "BF:gpt:w", 0, 1, NULL }, diff --git a/cmd-show-prompt-history.c b/cmd-show-prompt-history.c index 5b6af76fb..ecf1045c0 100644 --- a/cmd-show-prompt-history.c +++ b/cmd-show-prompt-history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-show-prompt-history.c,v 1.5 2026/06/25 11:39:11 nicm Exp $ */ +/* $OpenBSD: cmd-show-prompt-history.c,v 1.6 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2021 Anindya Mukherjee @@ -29,6 +29,7 @@ static enum cmd_retval cmd_show_prompt_history_exec(struct cmd *, const struct cmd_entry cmd_show_prompt_history_entry = { .name = "show-prompt-history", + .description = "Show interactive prompt history.", .alias = "showphist", .args = { "T:", 0, 0, NULL }, @@ -40,6 +41,7 @@ const struct cmd_entry cmd_show_prompt_history_entry = { const struct cmd_entry cmd_clear_prompt_history_entry = { .name = "clear-prompt-history", + .description = "Clear interactive prompt history.", .alias = "clearphist", .args = { "T:", 0, 0, NULL }, diff --git a/cmd-source-file.c b/cmd-source-file.c index 9c48c6f17..422537648 100644 --- a/cmd-source-file.c +++ b/cmd-source-file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-source-file.c,v 1.63 2026/08/18 08:05:05 nicm Exp $ */ +/* $OpenBSD: cmd-source-file.c,v 1.64 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2008 Tiago Cunha @@ -38,6 +38,7 @@ static enum cmd_retval cmd_source_file_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_source_file_entry = { .name = "source-file", + .description = "Load commands from a configuration file.", .alias = "source", .args = { "t:Fnqv", 1, -1, NULL }, diff --git a/cmd-split-window.c b/cmd-split-window.c index 71812308c..c7be68fa4 100644 --- a/cmd-split-window.c +++ b/cmd-split-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-split-window.c,v 1.152 2026/10/02 12:48:52 nicm Exp $ */ +/* $OpenBSD: cmd-split-window.c,v 1.153 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -39,6 +39,7 @@ static void cmd_split_window_mouse_resize(struct client *, const struct cmd_entry cmd_new_pane_entry = { .name = "new-pane", + .description = "Create a floating pane.", .alias = "newp", .args = { "AbB:Cc:Dde:EfF:hIkl:KLMm:Op:PR:s:S:t:T:vWx:X:y:Y:Z", 0, -1, NULL }, @@ -58,6 +59,7 @@ const struct cmd_entry cmd_new_pane_entry = { const struct cmd_entry cmd_split_window_entry = { .name = "split-window", + .description = "Create a new pane by splitting a window.", .alias = "splitw", .args = { "bB:c:de:EfF:hIkl:m:p:PR:s:S:t:T:vWZ", 0, -1, NULL }, diff --git a/cmd-swap-pane.c b/cmd-swap-pane.c index 1d0664cd6..76d2928f2 100644 --- a/cmd-swap-pane.c +++ b/cmd-swap-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-swap-pane.c,v 1.56 2026/10/02 12:23:44 nicm Exp $ */ +/* $OpenBSD: cmd-swap-pane.c,v 1.57 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -30,6 +30,7 @@ static enum cmd_retval cmd_swap_pane_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_swap_pane_entry = { .name = "swap-pane", + .description = "Swap two panes.", .alias = "swapp", .args = { "dDs:t:UZ", 0, 0, NULL }, diff --git a/cmd-swap-window.c b/cmd-swap-window.c index 0141e6a57..f5f5bdd16 100644 --- a/cmd-swap-window.c +++ b/cmd-swap-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-swap-window.c,v 1.30 2026/07/27 08:03:01 nicm Exp $ */ +/* $OpenBSD: cmd-swap-window.c,v 1.31 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -30,6 +30,7 @@ static enum cmd_retval cmd_swap_window_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_swap_window_entry = { .name = "swap-window", + .description = "Swap two windows.", .alias = "swapw", .args = { "ds:t:", 0, 0, NULL }, diff --git a/cmd-switch-client.c b/cmd-switch-client.c index 44ea43cbc..19a04cf39 100644 --- a/cmd-switch-client.c +++ b/cmd-switch-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-switch-client.c,v 1.75 2026/08/20 09:19:24 nicm Exp $ */ +/* $OpenBSD: cmd-switch-client.c,v 1.76 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -33,6 +33,7 @@ static enum cmd_retval cmd_switch_client_exec(struct cmd *, const struct cmd_entry cmd_switch_client_entry = { .name = "switch-client", + .description = "Switch a client to another session.", .alias = "switchc", .args = { "c:EFlnO:pt:rT:Z", 0, 0, NULL }, diff --git a/cmd-unbind-key.c b/cmd-unbind-key.c index f537fb576..63663c6c7 100644 --- a/cmd-unbind-key.c +++ b/cmd-unbind-key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-unbind-key.c,v 1.34 2021/08/21 10:22:39 nicm Exp $ */ +/* $OpenBSD: cmd-unbind-key.c,v 1.35 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -30,6 +30,7 @@ static enum cmd_retval cmd_unbind_key_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_unbind_key_entry = { .name = "unbind-key", + .description = "Remove key bindings.", .alias = "unbind", .args = { "anqT:", 0, 1, NULL }, diff --git a/cmd-wait-for.c b/cmd-wait-for.c index 7326c7519..77c4bd6eb 100644 --- a/cmd-wait-for.c +++ b/cmd-wait-for.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-wait-for.c,v 1.24 2026/09/22 06:46:50 nicm Exp $ */ +/* $OpenBSD: cmd-wait-for.c,v 1.25 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott @@ -32,6 +32,7 @@ static enum cmd_retval cmd_wait_for_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_wait_for_entry = { .name = "wait-for", + .description = "Wait for or signal named channels and events.", .alias = "wait", .args = { "EF:LSUlvw:", 1, 1, NULL }, diff --git a/options-table.c b/options-table.c index c15a84ce3..6aefe1dd7 100644 --- a/options-table.c +++ b/options-table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options-table.c,v 1.251 2026/10/07 12:59:50 nicm Exp $ */ +/* $OpenBSD: options-table.c,v 1.252 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott @@ -330,7 +330,8 @@ const struct options_table_entry options_table[] = { "server-info=show-messages -JT," "info=show-messages -JT," "choose-window=choose-tree -w," - "choose-session=choose-tree -s", + "choose-session=choose-tree -s," + "help=list-commands -h", .separator = ",", .text = "Array of command aliases. " "Each entry is an alias and a command separated by '='." diff --git a/tmux.1 b/tmux.1 index d2f0b751f..ac47986a5 100644 --- a/tmux.1 +++ b/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.1181 2026/10/08 07:50:05 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.1182 2026/10/09 13:12:14 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: October 8 2026 $ +.Dd $Mdocdate: October 9 2026 $ .Dt TMUX 1 .Os .Sh NAME @@ -1269,6 +1269,7 @@ If is specified, list only clients connected to that session. .Tg lscm .It Xo Ic list\-commands +.Op Fl h .Op Fl F Ar format .Op Ar command .Xc @@ -1277,6 +1278,11 @@ List the syntax of .Ar command or - if omitted - of all commands supported by .Nm . +With +.Fl h , +show command names and a short description. +.Fl h +twice shows syntax as well. .Tg ls .It Xo Ic list\-sessions .Op Fl r @@ -7407,7 +7413,9 @@ The following variables are available, where appropriate: .It Li "client_written" Ta "" Ta "Bytes written to client" .It Li "command" Ta "" Ta "Name of command in use, if any" .It Li "command_list_alias" Ta "" Ta "Command alias if listing commands" +.It Li "command_list_description" Ta "" Ta "Command description if listing commands" .It Li "command_list_name" Ta "" Ta "Command name if listing commands" +.It Li "command_list_name_width" Ta "" Ta "Maximum command name width in list" .It Li "command_list_usage" Ta "" Ta "Command usage if listing commands" .It Li "config_files" Ta "" Ta "List of configuration files loaded" .It Li "cursor_blinking" Ta "" Ta "1 if the cursor is blinking" diff --git a/tmux.h b/tmux.h index c442066b5..fdea4145a 100644 --- a/tmux.h +++ b/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.1454 2026/10/08 07:50:05 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.1455 2026/10/09 13:12:14 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -2033,6 +2033,7 @@ struct cmd_entry_flag { /* Command definition. */ struct cmd_entry { const char *name; + const char *description; const char *alias; struct args_parse args;