mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Add CMD_AFTERHOOK flag to the easy commands that don't need any special handling.
This commit is contained in:
parent
d413a945ac
commit
ed971268be
@ -40,7 +40,7 @@ const struct cmd_entry cmd_bind_key_entry = {
|
|||||||
.usage = "[-cnr] [-t mode-table] [-T key-table] key "
|
.usage = "[-cnr] [-t mode-table] [-T key-table] key "
|
||||||
"command [arguments]",
|
"command [arguments]",
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_bind_key_exec
|
.exec = cmd_bind_key_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ const struct cmd_entry cmd_capture_pane_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_PANE,
|
.tflag = CMD_PANE,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_capture_pane_exec
|
.exec = cmd_capture_pane_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ const struct cmd_entry cmd_clear_history_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_PANE,
|
.tflag = CMD_PANE,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_clear_history_exec
|
.exec = cmd_clear_history_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ const struct cmd_entry cmd_copy_mode_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_PANE,
|
.tflag = CMD_PANE,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_copy_mode_exec
|
.exec = cmd_copy_mode_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ const struct cmd_entry cmd_clock_mode_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_PANE,
|
.tflag = CMD_PANE,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_copy_mode_exec
|
.exec = cmd_copy_mode_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ const struct cmd_entry cmd_display_panes_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_CLIENT,
|
.tflag = CMD_CLIENT,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_display_panes_exec
|
.exec = cmd_display_panes_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ const struct cmd_entry cmd_list_buffers_entry = {
|
|||||||
.args = { "F:", 0, 0 },
|
.args = { "F:", 0, 0 },
|
||||||
.usage = "[-F format]",
|
.usage = "[-F format]",
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_list_buffers_exec
|
.exec = cmd_list_buffers_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ const struct cmd_entry cmd_list_clients_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_SESSION,
|
.tflag = CMD_SESSION,
|
||||||
|
|
||||||
.flags = CMD_READONLY,
|
.flags = CMD_READONLY|CMD_AFTERHOOK,
|
||||||
.exec = cmd_list_clients_exec
|
.exec = cmd_list_clients_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ const struct cmd_entry cmd_list_keys_entry = {
|
|||||||
.args = { "t:T:", 0, 0 },
|
.args = { "t:T:", 0, 0 },
|
||||||
.usage = "[-t mode-table] [-T key-table]",
|
.usage = "[-t mode-table] [-T key-table]",
|
||||||
|
|
||||||
.flags = CMD_STARTSERVER,
|
.flags = CMD_STARTSERVER|CMD_AFTERHOOK,
|
||||||
.exec = cmd_list_keys_exec
|
.exec = cmd_list_keys_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ const struct cmd_entry cmd_list_commands_entry = {
|
|||||||
.args = { "F:", 0, 0 },
|
.args = { "F:", 0, 0 },
|
||||||
.usage = "[-F format]",
|
.usage = "[-F format]",
|
||||||
|
|
||||||
.flags = CMD_STARTSERVER,
|
.flags = CMD_STARTSERVER|CMD_AFTERHOOK,
|
||||||
.exec = cmd_list_keys_exec
|
.exec = cmd_list_keys_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ const struct cmd_entry cmd_list_panes_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_WINDOW,
|
.tflag = CMD_WINDOW,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_list_panes_exec
|
.exec = cmd_list_panes_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ const struct cmd_entry cmd_list_sessions_entry = {
|
|||||||
.args = { "F:", 0, 0 },
|
.args = { "F:", 0, 0 },
|
||||||
.usage = "[-F format]",
|
.usage = "[-F format]",
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_list_sessions_exec
|
.exec = cmd_list_sessions_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ const struct cmd_entry cmd_list_windows_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_SESSION,
|
.tflag = CMD_SESSION,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_list_windows_exec
|
.exec = cmd_list_windows_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ const struct cmd_entry cmd_load_buffer_entry = {
|
|||||||
.args = { "b:", 1, 1 },
|
.args = { "b:", 1, 1 },
|
||||||
.usage = CMD_BUFFER_USAGE " path",
|
.usage = CMD_BUFFER_USAGE " path",
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_load_buffer_exec
|
.exec = cmd_load_buffer_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ const struct cmd_entry cmd_lock_server_entry = {
|
|||||||
.args = { "", 0, 0 },
|
.args = { "", 0, 0 },
|
||||||
.usage = "",
|
.usage = "",
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_lock_server_exec
|
.exec = cmd_lock_server_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ const struct cmd_entry cmd_lock_session_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_SESSION,
|
.tflag = CMD_SESSION,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_lock_server_exec
|
.exec = cmd_lock_server_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ const struct cmd_entry cmd_lock_client_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_CLIENT,
|
.tflag = CMD_CLIENT,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_lock_server_exec
|
.exec = cmd_lock_server_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ const struct cmd_entry cmd_paste_buffer_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_PANE,
|
.tflag = CMD_PANE,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_paste_buffer_exec
|
.exec = cmd_paste_buffer_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ const struct cmd_entry cmd_pipe_pane_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_PANE,
|
.tflag = CMD_PANE,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_pipe_pane_exec
|
.exec = cmd_pipe_pane_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ const struct cmd_entry cmd_refresh_client_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_CLIENT,
|
.tflag = CMD_CLIENT,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_refresh_client_exec
|
.exec = cmd_refresh_client_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ const struct cmd_entry cmd_rename_session_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_SESSION,
|
.tflag = CMD_SESSION,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_rename_session_exec
|
.exec = cmd_rename_session_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ const struct cmd_entry cmd_rename_window_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_WINDOW,
|
.tflag = CMD_WINDOW,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_rename_window_exec
|
.exec = cmd_rename_window_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ const struct cmd_entry cmd_resize_pane_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_PANE,
|
.tflag = CMD_PANE,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_resize_pane_exec
|
.exec = cmd_resize_pane_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ const struct cmd_entry cmd_save_buffer_entry = {
|
|||||||
.args = { "ab:", 1, 1 },
|
.args = { "ab:", 1, 1 },
|
||||||
.usage = "[-a] " CMD_BUFFER_USAGE " path",
|
.usage = "[-a] " CMD_BUFFER_USAGE " path",
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_save_buffer_exec
|
.exec = cmd_save_buffer_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ const struct cmd_entry cmd_show_buffer_entry = {
|
|||||||
.args = { "b:", 0, 0 },
|
.args = { "b:", 0, 0 },
|
||||||
.usage = CMD_BUFFER_USAGE,
|
.usage = CMD_BUFFER_USAGE,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_save_buffer_exec
|
.exec = cmd_save_buffer_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ const struct cmd_entry cmd_select_layout_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_WINDOW,
|
.tflag = CMD_WINDOW,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_select_layout_exec
|
.exec = cmd_select_layout_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ const struct cmd_entry cmd_next_layout_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_WINDOW,
|
.tflag = CMD_WINDOW,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_select_layout_exec
|
.exec = cmd_select_layout_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ const struct cmd_entry cmd_previous_layout_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_WINDOW,
|
.tflag = CMD_WINDOW,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_select_layout_exec
|
.exec = cmd_select_layout_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ const struct cmd_entry cmd_send_keys_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_PANE,
|
.tflag = CMD_PANE,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_send_keys_exec
|
.exec = cmd_send_keys_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ const struct cmd_entry cmd_send_prefix_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_PANE,
|
.tflag = CMD_PANE,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_send_keys_exec
|
.exec = cmd_send_keys_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ const struct cmd_entry cmd_set_buffer_entry = {
|
|||||||
.args = { "ab:n:", 0, 1 },
|
.args = { "ab:n:", 0, 1 },
|
||||||
.usage = "[-a] " CMD_BUFFER_USAGE " [-n new-buffer-name] data",
|
.usage = "[-a] " CMD_BUFFER_USAGE " [-n new-buffer-name] data",
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_set_buffer_exec
|
.exec = cmd_set_buffer_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ const struct cmd_entry cmd_delete_buffer_entry = {
|
|||||||
.args = { "b:", 0, 0 },
|
.args = { "b:", 0, 0 },
|
||||||
.usage = CMD_BUFFER_USAGE,
|
.usage = CMD_BUFFER_USAGE,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_set_buffer_exec
|
.exec = cmd_set_buffer_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ const struct cmd_entry cmd_set_environment_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_SESSION_CANFAIL,
|
.tflag = CMD_SESSION_CANFAIL,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_set_environment_exec
|
.exec = cmd_set_environment_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ const struct cmd_entry cmd_set_hook_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_SESSION_CANFAIL,
|
.tflag = CMD_SESSION_CANFAIL,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_set_hook_exec
|
.exec = cmd_set_hook_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ const struct cmd_entry cmd_show_hooks_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_SESSION,
|
.tflag = CMD_SESSION,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_set_hook_exec
|
.exec = cmd_set_hook_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ const struct cmd_entry cmd_set_option_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_WINDOW_CANFAIL,
|
.tflag = CMD_WINDOW_CANFAIL,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_set_option_exec
|
.exec = cmd_set_option_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ const struct cmd_entry cmd_set_window_option_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_WINDOW_CANFAIL,
|
.tflag = CMD_WINDOW_CANFAIL,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_set_option_exec
|
.exec = cmd_set_option_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ const struct cmd_entry cmd_show_environment_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_SESSION_CANFAIL,
|
.tflag = CMD_SESSION_CANFAIL,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_show_environment_exec
|
.exec = cmd_show_environment_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ const struct cmd_entry cmd_show_messages_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_CLIENT,
|
.tflag = CMD_CLIENT,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_show_messages_exec
|
.exec = cmd_show_messages_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ const struct cmd_entry cmd_server_info_entry = {
|
|||||||
.args = { "", 0, 0 },
|
.args = { "", 0, 0 },
|
||||||
.usage = "",
|
.usage = "",
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_show_messages_exec
|
.exec = cmd_show_messages_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ const struct cmd_entry cmd_show_options_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_WINDOW_CANFAIL,
|
.tflag = CMD_WINDOW_CANFAIL,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_show_options_exec
|
.exec = cmd_show_options_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ const struct cmd_entry cmd_show_window_options_entry = {
|
|||||||
|
|
||||||
.tflag = CMD_WINDOW_CANFAIL,
|
.tflag = CMD_WINDOW_CANFAIL,
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_show_options_exec
|
.exec = cmd_show_options_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -133,7 +133,8 @@ cmd_string_parse(const char *s, struct cmd_list **cmdlist, const char *file,
|
|||||||
if (argc == 0)
|
if (argc == 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
*cmdlist = cmd_list_parse(argc, argv, file, line, cause);
|
*cmdlist = cmd_list_parse(argc, argv, file, line,
|
||||||
|
cause);
|
||||||
if (*cmdlist == NULL)
|
if (*cmdlist == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ const struct cmd_entry cmd_unbind_key_entry = {
|
|||||||
.args = { "ant:T:", 0, 1 },
|
.args = { "ant:T:", 0, 1 },
|
||||||
.usage = "[-an] [-t mode-table] [-T key-table] key",
|
.usage = "[-an] [-t mode-table] [-T key-table] key",
|
||||||
|
|
||||||
.flags = 0,
|
.flags = CMD_AFTERHOOK,
|
||||||
.exec = cmd_unbind_key_exec
|
.exec = cmd_unbind_key_exec
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user