tmux
3.2a
About: tmux is a terminal multiplexer that lets you switch easily between several programs in one terminal.
![]() ![]() |
#include <sys/types.h>
#include <sys/time.h>
#include <fnmatch.h>
#include <pwd.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "tmux.h"
Go to the source code of this file.
Data Structures | |
struct | cmd |
Functions | |
TAILQ_HEAD (cmds, cmd) | |
void | cmd_log_argv (int argc, char **argv, const char *fmt,...) |
void | cmd_prepend_argv (int *argc, char ***argv, char *arg) |
void | cmd_append_argv (int *argc, char ***argv, char *arg) |
int | cmd_pack_argv (int argc, char **argv, char *buf, size_t len) |
int | cmd_unpack_argv (char *buf, size_t len, int argc, char ***argv) |
char ** | cmd_copy_argv (int argc, char **argv) |
void | cmd_free_argv (int argc, char **argv) |
char * | cmd_stringify_argv (int argc, char **argv) |
const struct cmd_entry * | cmd_get_entry (struct cmd *cmd) |
struct args * | cmd_get_args (struct cmd *cmd) |
u_int | cmd_get_group (struct cmd *cmd) |
void | cmd_get_source (struct cmd *cmd, const char **file, u_int *line) |
char * | cmd_get_alias (const char *name) |
static const struct cmd_entry * | cmd_find (const char *name, char **cause) |
struct cmd * | cmd_parse (int argc, char **argv, const char *file, u_int line, char **cause) |
void | cmd_free (struct cmd *cmd) |
char * | cmd_print (struct cmd *cmd) |
struct cmd_list * | cmd_list_new (void) |
void | cmd_list_append (struct cmd_list *cmdlist, struct cmd *cmd) |
void | cmd_list_move (struct cmd_list *cmdlist, struct cmd_list *from) |
void | cmd_list_free (struct cmd_list *cmdlist) |
char * | cmd_list_print (struct cmd_list *cmdlist, int escaped) |
struct cmd * | cmd_list_first (struct cmd_list *cmdlist) |
struct cmd * | cmd_list_next (struct cmd *cmd) |
int | cmd_list_all_have (struct cmd_list *cmdlist, int flag) |
int | cmd_list_any_have (struct cmd_list *cmdlist, int flag) |
int | cmd_mouse_at (struct window_pane *wp, struct mouse_event *m, u_int *xp, u_int *yp, int last) |
struct winlink * | cmd_mouse_window (struct mouse_event *m, struct session **sp) |
struct window_pane * | cmd_mouse_pane (struct mouse_event *m, struct session **sp, struct winlink **wlp) |
char * | cmd_template_replace (const char *template, const char *s, int idx) |
void cmd_append_argv | ( | int * | argc, |
char *** | argv, | ||
char * | arg | ||
) |
Definition at line 267 of file cmd.c.
References args::argc, args::argv, xreallocarray(), and xstrdup().
Referenced by cmd_parse_build_commands().
char** cmd_copy_argv | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 327 of file cmd.c.
References args::argc, args::argv, xcalloc(), and xstrdup().
Referenced by args_parse(), cmd_parse(), cmd_parse_from_arguments(), and spawn_pane().
|
static |
Definition at line 448 of file cmd.c.
References cmd_entry::alias, cmd_table, name, cmd_entry::name, strlcat(), and xasprintf().
Referenced by cmd_parse().
void cmd_free | ( | struct cmd * | cmd | ) |
Definition at line 547 of file cmd.c.
References cmd::alias, cmd::argc, cmd::args, args_free(), cmd::argv, cmd_free_argv(), and cmd::file.
Referenced by cmd_list_free().
void cmd_free_argv | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 344 of file cmd.c.
References args::argc, and args::argv.
Referenced by args_free(), cmd_free(), cmd_parse_free_command(), cmd_parse_from_arguments(), cmd_unpack_argv(), format_free_modifiers(), server_client_dispatch_command(), spawn_pane(), and window_pane_destroy().
char* cmd_get_alias | ( | const char * | name | ) |
Definition at line 417 of file cmd.c.
References global_options, name, options_array_first(), options_array_item_value(), options_array_next(), options_get_only(), options_value::string, and xstrdup().
Referenced by cmd_parse_build_commands().
Definition at line 393 of file cmd.c.
References cmd::args.
Referenced by cmd_list_panes_window(), cmd_list_windows_session(), cmd_show_environment_exec(), cmd_show_messages_exec(), cmd_show_options_all(), and cmdq_insert_hook().
Definition at line 386 of file cmd.c.
References cmd::entry.
Referenced by cmdq_find_flag(), and cmdq_merge_formats().
u_int cmd_get_group | ( | struct cmd * | cmd | ) |
void cmd_get_source | ( | struct cmd * | cmd, |
const char ** | file, | ||
u_int * | line | ||
) |
Definition at line 407 of file cmd.c.
References cmd::file, and cmd::line.
Referenced by cmdq_error().
int cmd_list_all_have | ( | struct cmd_list * | cmdlist, |
int | flag | ||
) |
Definition at line 677 of file cmd.c.
References cmd::entry, cmd_entry::flags, and cmd_list::list.
Referenced by key_bindings_dispatch().
int cmd_list_any_have | ( | struct cmd_list * | cmdlist, |
int | flag | ||
) |
Definition at line 690 of file cmd.c.
References cmd::entry, cmd_entry::flags, and cmd_list::list.
Referenced by client_main().
Definition at line 590 of file cmd.c.
References cmd::group, cmd_list::group, and cmd_list::list.
Referenced by cmd_parse_build_commands().
void cmd_list_free | ( | struct cmd_list * | cmdlist | ) |
Definition at line 606 of file cmd.c.
References cmd_free(), cmd_list::list, and cmd_list::references.
Referenced by client_main(), cmd_if_shell_callback(), cmd_parse_build_commands(), cmdq_remove(), key_bindings_free(), key_bindings_init(), key_bindings_reset(), load_cfg(), load_cfg_from_buffer(), options_value_free(), server_client_dispatch_command(), and window_customize_set_command_callback().
Definition at line 598 of file cmd.c.
References cmd_list_next_group, cmd_list::group, and cmd_list::list.
Referenced by cmd_parse_build_commands().
struct cmd_list* cmd_list_new | ( | void | ) |
Definition at line 576 of file cmd.c.
References cmd_list_next_group, cmd_list::group, cmd_list::list, cmd_list::references, and xcalloc().
Referenced by cmd_parse_build_commands().
Definition at line 670 of file cmd.c.
Referenced by cmdq_find_flag().
char* cmd_list_print | ( | struct cmd_list * | cmdlist, |
int | escaped | ||
) |
Definition at line 623 of file cmd.c.
References cmd_print(), cmd::group, cmd_list::list, strlcat(), xcalloc(), and xrealloc().
Referenced by cmd_list_keys_print_notes(), cmd_parse_build_commands(), cmd_parse_print_commands(), key_bindings_add(), options_value_to_string(), window_customize_build_keys(), window_customize_draw_key(), and window_customize_set_key().
void cmd_log_argv | ( | int | argc, |
char ** | argv, | ||
const char * | fmt, | ||
... | |||
) |
Definition at line 233 of file cmd.c.
References args::argc, args::argv, log_debug(), and xvasprintf().
Referenced by cmd_pack_argv(), cmd_parse(), cmd_parse_build_commands(), cmd_parse_from_arguments(), cmd_unpack_argv(), and spawn_pane().
int cmd_mouse_at | ( | struct window_pane * | wp, |
struct mouse_event * | m, | ||
u_int * | xp, | ||
u_int * | yp, | ||
int | last | ||
) |
Definition at line 703 of file cmd.c.
References log_debug(), mouse_event::lx, mouse_event::ly, mouse_event::ox, mouse_event::oy, mouse_event::statusat, mouse_event::statuslines, window_pane::sx, window_pane::sy, mouse_event::x, window_pane::xoff, mouse_event::y, and window_pane::yoff.
Referenced by format_cb_mouse_line(), format_cb_mouse_word(), format_cb_mouse_x(), format_cb_mouse_y(), input_key_mouse(), mode_tree_key(), window_copy_drag_update(), window_copy_move_mouse(), and window_copy_start_drag().
struct window_pane* cmd_mouse_pane | ( | struct mouse_event * | m, |
struct session ** | sp, | ||
struct winlink ** | wlp | ||
) |
Definition at line 758 of file cmd.c.
References cmd_mouse_window(), winlink::window, window_has_pane(), window_pane_find_by_id(), and mouse_event::wp.
Referenced by cmd_find_from_mouse(), cmd_find_target(), format_cb_mouse_line(), format_cb_mouse_pane(), format_cb_mouse_word(), format_cb_mouse_x(), format_cb_mouse_y(), window_copy_drag_release(), window_copy_drag_update(), window_copy_move_mouse(), and window_copy_start_drag().
struct winlink* cmd_mouse_window | ( | struct mouse_event * | m, |
struct session ** | sp | ||
) |
Definition at line 734 of file cmd.c.
References session::curw, mouse_event::s, session_find_by_id(), mouse_event::valid, mouse_event::w, window_find_by_id(), session::windows, and winlink_find_by_window().
Referenced by cmd_find_target(), cmd_mouse_pane(), and cmd_resize_pane_mouse_update().
int cmd_pack_argv | ( | int | argc, |
char ** | argv, | ||
char * | buf, | ||
size_t | len | ||
) |
Definition at line 275 of file cmd.c.
References args::argc, args::argv, cmd_log_argv(), and strlcpy().
Referenced by client_main().
struct cmd* cmd_parse | ( | int | argc, |
char ** | argv, | ||
const char * | file, | ||
u_int | line, | ||
char ** | cause | ||
) |
Definition at line 498 of file cmd.c.
References cmd::alias, cmd::argc, args::argc, cmd::args, cmd_entry::args, args_free(), args_parse(), cmd::argv, args::argv, cmd_copy_argv(), cmd_find(), cmd_log_argv(), cmd::entry, cmd::file, cmd::line, cmd_entry::lower, name, cmd_entry::name, cmd_entry::template, cmd_entry::upper, usage(), cmd_entry::usage, xasprintf(), xcalloc(), and xstrdup().
Referenced by cmd_parse_build_commands().
void cmd_prepend_argv | ( | int * | argc, |
char *** | argv, | ||
char * | arg | ||
) |
Definition at line 250 of file cmd.c.
References args::argc, args::argv, xreallocarray(), and xstrdup().
Referenced by yyparse().
char* cmd_print | ( | struct cmd * | cmd | ) |
Definition at line 560 of file cmd.c.
References cmd::args, args_print(), cmd::entry, cmd_entry::name, xasprintf(), and xstrdup().
Referenced by cmd_list_print(), and cmdq_add_message().
char* cmd_stringify_argv | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 357 of file cmd.c.
References args::argc, args_escape(), args::argv, log_debug(), strlcat(), xrealloc(), and xstrdup().
Referenced by cmd_parse_commands_to_string(), default_window_name(), format_cb_current_command(), format_cb_start_command(), and spawn_pane().
char* cmd_template_replace | ( | const char * | template, |
const char * | s, | ||
int | idx | ||
) |
Definition at line 778 of file cmd.c.
References xmalloc(), xrealloc(), and xstrdup().
Referenced by cmd_command_prompt_callback(), cmd_display_panes_exec(), and mode_tree_run_command().
int cmd_unpack_argv | ( | char * | buf, |
size_t | len, | ||
int | argc, | ||
char *** | argv | ||
) |
Definition at line 298 of file cmd.c.
References args::argc, args::argv, cmd_free_argv(), cmd_log_argv(), xcalloc(), and xstrdup().
Referenced by server_client_dispatch_command().
TAILQ_HEAD | ( | cmds | , |
cmd | |||
) |
|
extern |
Definition at line 1 of file cmd-attach-session.c.
|
extern |
Definition at line 1 of file cmd-bind-key.c.
|
extern |
Definition at line 1 of file cmd-break-pane.c.
|
extern |
Definition at line 35 of file cmd-capture-pane.c.
|
extern |
Definition at line 1 of file cmd-choose-tree.c.
|
extern |
Definition at line 1 of file cmd-choose-tree.c.
|
extern |
Definition at line 1 of file cmd-choose-tree.c.
|
extern |
Definition at line 35 of file cmd-capture-pane.c.
|
extern |
Definition at line 1 of file cmd-copy-mode.c.
|
extern |
Definition at line 37 of file cmd-command-prompt.c.
|
extern |
Definition at line 36 of file cmd-confirm-before.c.
|
extern |
Definition at line 1 of file cmd-copy-mode.c.
|
extern |
Definition at line 1 of file cmd-choose-tree.c.
|
extern |
Definition at line 1 of file cmd-set-buffer.c.
|
extern |
Definition at line 1 of file cmd-detach-client.c.
|
extern |
Definition at line 1 of file cmd-display-menu.c.
|
extern |
Definition at line 1 of file cmd-display-message.c.
|
extern |
Definition at line 1 of file cmd-display-panes.c.
|
extern |
Definition at line 1 of file cmd-display-menu.c.
|
extern |
|
extern |
Definition at line 1 of file cmd-find-window.c.
|
extern |
Definition at line 1 of file cmd-new-session.c.
|
extern |
Definition at line 35 of file cmd-if-shell.c.
|
extern |
Definition at line 1 of file cmd-join-pane.c.
|
extern |
Definition at line 1 of file cmd-kill-pane.c.
|
extern |
Definition at line 1 of file cmd-kill-server.c.
|
extern |
Definition at line 1 of file cmd-kill-session.c.
|
extern |
Definition at line 1 of file cmd-kill-window.c.
|
extern |
Definition at line 1 of file cmd-select-pane.c.
|
extern |
Definition at line 1 of file cmd-select-window.c.
|
extern |
Definition at line 1 of file cmd-move-window.c.
|
extern |
Definition at line 1 of file cmd-list-buffers.c.
|
extern |
Definition at line 1 of file cmd-list-clients.c.
|
extern |
Definition at line 1 of file cmd-list-keys.c.
|
extern |
Definition at line 1 of file cmd-list-keys.c.
|
static |
Definition at line 229 of file cmd.c.
Referenced by cmd_list_move(), and cmd_list_new().
|
extern |
Definition at line 34 of file cmd-list-panes.c.
|
extern |
Definition at line 1 of file cmd-list-sessions.c.
|
extern |
Definition at line 45 of file cmd-list-windows.c.
|
extern |
Definition at line 1 of file cmd-load-buffer.c.
|
extern |
Definition at line 1 of file cmd-lock-server.c.
|
extern |
Definition at line 1 of file cmd-lock-server.c.
|
extern |
Definition at line 1 of file cmd-lock-server.c.
|
extern |
Definition at line 1 of file cmd-join-pane.c.
|
extern |
Definition at line 1 of file cmd-move-window.c.
|
extern |
Definition at line 1 of file cmd-new-session.c.
|
extern |
Definition at line 1 of file cmd-new-window.c.
|
extern |
Definition at line 1 of file cmd-select-layout.c.
|
extern |
Definition at line 1 of file cmd-select-window.c.
|
extern |
Definition at line 1 of file cmd-paste-buffer.c.
|
extern |
Definition at line 40 of file cmd-pipe-pane.c.
|
extern |
Definition at line 1 of file cmd-select-layout.c.
|
extern |
Definition at line 1 of file cmd-select-window.c.
|
extern |
Definition at line 1 of file cmd-refresh-client.c.
|
extern |
Definition at line 1 of file cmd-rename-session.c.
|
extern |
Definition at line 1 of file cmd-rename-window.c.
|
extern |
Definition at line 32 of file cmd-resize-pane.c.
|
extern |
Definition at line 1 of file cmd-resize-window.c.
|
extern |
Definition at line 1 of file cmd-respawn-pane.c.
|
extern |
Definition at line 1 of file cmd-respawn-window.c.
|
extern |
Definition at line 1 of file cmd-rotate-window.c.
|
extern |
Definition at line 38 of file cmd-run-shell.c.
|
extern |
Definition at line 1 of file cmd-save-buffer.c.
|
extern |
Definition at line 1 of file cmd-select-layout.c.
|
extern |
Definition at line 1 of file cmd-select-pane.c.
|
extern |
Definition at line 1 of file cmd-select-window.c.
|
extern |
Definition at line 1 of file cmd-send-keys.c.
|
extern |
Definition at line 1 of file cmd-send-keys.c.
|
extern |
Definition at line 1 of file cmd-set-buffer.c.
|
extern |
Definition at line 1 of file cmd-set-environment.c.
|
extern |
Definition at line 1 of file cmd-set-option.c.
|
extern |
Definition at line 1 of file cmd-set-option.c.
|
extern |
Definition at line 1 of file cmd-set-option.c.
|
extern |
Definition at line 1 of file cmd-save-buffer.c.
|
extern |
Definition at line 34 of file cmd-show-environment.c.
|
extern |
Definition at line 32 of file cmd-show-options.c.
|
extern |
Definition at line 1 of file cmd-show-messages.c.
|
extern |
Definition at line 32 of file cmd-show-options.c.
|
extern |
Definition at line 32 of file cmd-show-options.c.
|
extern |
Definition at line 1 of file cmd-source-file.c.
|
extern |
Definition at line 1 of file cmd-split-window.c.
|
extern |
Definition at line 1 of file cmd-kill-server.c.
|
extern |
Definition at line 1 of file cmd-detach-client.c.
|
extern |
Definition at line 1 of file cmd-swap-pane.c.
|
extern |
Definition at line 1 of file cmd-swap-window.c.
|
extern |
Definition at line 1 of file cmd-switch-client.c.
const struct cmd_entry* cmd_table[] |
Definition at line 120 of file cmd.c.
Referenced by cmd_find(), and status_prompt_complete_list().
|
extern |
Definition at line 1 of file cmd-unbind-key.c.
|
extern |
Definition at line 1 of file cmd-kill-window.c.
|
extern |
|
extern |
Definition at line 1 of file cmd-wait-for.c.