tmuxtmuxC source reference

Choose documentation 1

3.2a

tmux source version

Latest (3.7c) 3.7c 3.2a
English

tmux C API

tmux C source reference

C declarations from tmux 3.2a. These are tmux internals, not a supported external library API.

tmux C symbol index (A–Z)

Paths through the source

source calls

Follow these functions to explore a task. Arrows show source relationships.

Create a session and its first pane

  1. cmd_new_session_exec
  2. calls → spawn_window
  3. calls → spawn_pane
  4. calls → window_add_pane
  5. calls → window_pane_create

Split a window

  1. cmd_split_window_exec
  2. references → spawn_pane
  3. calls → window_add_pane
  4. calls → window_pane_create

Start the server and create a client

  1. server_start
  2. calls → server_client_create
  3. calls → proc_add_peer
Server 6 functions and constants
Server — Supporting declarations 44 functions and constants
Session 1 type, 8 functions and constants
Session — Supporting declarations 3 types, 52 functions and constants
session_group struct 5 members
session_groups struct 1 member
sessions struct 1 member
session_groups attribute
sessions attribute
session_alive function
session_cmp function
session_free function
session_has function
session_last function
session_new function
session_next function
Window 2 types, 6 functions and constants
window struct 33 members
winlink struct 10 members
window_create function
window_resize function
Window — Supporting declarations 24 types, 360 functions and constants
window_buffer_editdata struct 3 members
window_buffer_itemdata struct 3 members
window_buffer_modedata struct 8 members
window_client_itemdata struct 1 member
window_client_modedata struct 7 members
window_clock_mode_data struct 3 members
window_copy_cmd_state struct 6 members
window_copy_mode_data struct 49 members
window_customize_itemdata struct 7 members
window_customize_modedata struct 10 members
window_tree_itemdata struct 4 members
window_tree_modedata struct 19 members
windows struct 1 member
winlink_stack struct 2 members
winlinks struct 1 member
window_copy_cmd_action enum 3 members
window_copy_cmd_clear enum 3 members
window_customize_scope enum 8 members
window_tree_sort_type enum 3 members
window_tree_type enum 4 members
next_window_id attribute
windows attribute
window_cmp function
window_unzoom function
window_zoom function
Pane 1 type, 6 functions and constants
Pane — Supporting declarations 10 types, 52 functions and constants
window_mode struct 10 members
window_mode_entry struct 8 members
window_pane_input_data struct 2 members
window_pane_offset struct 1 member
window_pane_resize struct 6 members
window_pane_resizes struct 2 members
window_pane_tree struct 1 member
window_panes struct 2 members
anonymous enum enum 7 members
anonymous enum enum 3 members
Client 1 type, 5 functions and constants
Client — Supporting declarations 6 types, 96 functions and constants
anonymous enum enum 9 members
client_file struct 15 members
client_files struct 1 member
client_window struct 4 members
client_windows struct 1 member
clients struct 2 members
client_file_cb type alias
client_execcmd attribute
client_exitval attribute
client_files attribute
client_flags attribute
client_peer attribute
client_proc attribute
clients attribute
client_exec function
client_exit function
client_signal function
Commands 5 types, 5 functions and constants
cmd struct 10 members
cmd_entry struct 9 members
args struct 3 members
cmd_parse_result struct 3 members
cmd_find_state struct 7 members
cmdq_append function
cmdq_next function
Commands — Supporting declarations 26 types, 363 functions and constants
cmdq_type enum 2 members
args_entry struct 5 members
args_tree struct 1 member
args_value struct 3 members
args_values struct 2 members
cmd_command_prompt_cdata struct 7 members
cmd_confirm_before_data struct 1 member
cmd_display_panes_data struct 2 members
cmd_entry_flag struct 3 members
cmd_if_shell_data struct 5 members
cmd_list struct 3 members
cmd_load_buffer_data struct 3 members
cmd_parse_input struct 6 members
cmd_run_shell_data struct 10 members
cmd_source_file_data struct 7 members
cmdq_item struct 19 members
cmdq_item_list struct 2 members
cmdq_list struct 2 members
cmdq_state struct 5 members
cmds struct 2 members
wait_channel struct 9 members
wait_channels struct 1 member
wait_item struct 3 members
cmd_find_type enum 3 members
cmd_retval enum 4 members
cmd_parse_status enum 3 members
cmd_table attribute
CMDQ_FIRED constant
CMDQ_WAITING constant
wait_channels attribute
args_cmp function
args_escape function
args_find function
args_first function
args_free function
args_get function
args_has function
args_next function
args_parse function
args_print function
args_set function
args_strtonum function
cmd_copy_argv function
cmd_find function
cmd_free function
cmd_free_argv function
cmd_get_alias function
cmd_get_args function
cmd_get_entry function
cmd_get_group function
cmd_list_free function
cmd_list_move function
cmd_list_new function
cmd_list_next function
cmd_log_argv function
cmd_mouse_at function
cmd_pack_argv function
cmd_parse function
cmd_print function
cmdq_continue function
cmdq_error function
cmdq_free function
cmdq_get function
cmdq_get_name function
cmdq_guard function
cmdq_name function
cmdq_new function
cmdq_print function
cmdq_remove function
cmdq_running function
Options and formats 3 types, 5 functions and constants
options struct 3 members
format_tree struct 14 members
environ struct 1 member
options_get function
format_create function
format_expand function
Options and formats — Supporting declarations 18 types, 398 functions and constants
format_type enum 4 members
format_table_type enum 2 members
environ_entry struct 5 members
format_entry struct 6 members
format_expand_state struct 5 members
format_job struct 11 members
format_job_tree struct 1 member
format_modifier struct 4 members
format_range struct 8 members
format_ranges struct 2 members
format_table_entry struct 3 members
options_array struct 1 member
options_array_item struct 4 members
options_entry struct 8 members
options_name_map struct 2 members
options_table_entry struct 15 members
options_table_type enum 7 members
options_value union 5 members
format_cb type alias
environ attribute
FORMAT_EXPAND constant
format_jobs attribute
FORMAT_LENGTH constant
format_log constant
format_lower attribute
FORMAT_PANES constant
FORMAT_PRETTY constant
format_table attribute
format_upper attribute
FORMAT_WIDTH constant
options_table attribute
environ_clear function
environ_cmp function
environ_copy function
environ_find function
environ_first function
environ_free function
environ_log function
environ_next function
environ_push function
environ_put function
environ_set function
environ_unset function
format_add function
format_add_cb function
format_add_tv function
format_cb_pid function
format_choose function
format_draw function
format_each function
format_find function
format_free function
format_is_end function
format_log1 function
format_match function
format_merge function
format_printf function
format_single function
format_skip function
format_strip function
format_sub function
format_true function
format_width function
options_add function
options_cmp function
options_empty function
options_first function
options_free function
options_match function
options_name function
options_next function
options_owner function
options_parse function
Screen and terminal 4 types, 5 functions and constants
screen struct 19 members
grid struct 7 members
grid_cell struct 6 members
tty struct 39 members
screen_init function
screen_resize function
Screen and terminal — Supporting declarations 42 types, 590 functions and constants
input_esc_type enum 15 members
input_csi_type enum 37 members
grid_cell_entry struct 3 members
grid_extd_entry struct 6 members
grid_line struct 6 members
grid_reader struct 3 members
input_cell struct 4 members
input_ctx struct 27 members
input_key_entry struct 4 members
input_key_tree struct 1 member
input_param struct 4 members
input_state struct 4 members
input_table_entry struct 3 members
input_transition struct 4 members
screen_redraw_ctx struct 9 members
screen_sel struct 8 members
screen_title_entry struct 3 members
screen_titles struct 2 members
screen_write_citem struct 9 members
screen_write_cline struct 3 members
screen_write_ctx struct 8 members
tty_acs_entry struct 2 members
tty_acs_reverse_entry struct 2 members
tty_code struct 3 members
tty_ctx struct 26 members
tty_default_key_code struct 2 members
tty_default_key_raw struct 2 members
tty_default_key_xterm struct 2 members
tty_feature struct 3 members
tty_key struct 5 members
tty_term struct 8 members
tty_term_code_entry struct 2 members
tty_terms struct 1 member
utf8_data struct 4 members
utf8_data_tree struct 1 member
utf8_index_tree struct 1 member
utf8_item struct 7 members
tty_code_code enum 227 members
utf8_state enum 3 members
tty_code_type enum 4 members
utf8_char type alias
CELL_BORDERS constant
CELL_INSIDE constant
CELL_JOIN constant
CELL_LEFTJOIN constant
CELL_OUTSIDE constant
CELL_TOPJOIN constant
CELL_TOPLEFT constant
CELL_TOPRIGHT constant
END_ISOLATE constant
grid_view_x constant
grid_view_y constant
INPUT_DISCARD constant
input_key_tree attribute
screen_hlimit constant
screen_hsize constant
screen_size_x constant
screen_size_y constant
START_ISOLATE constant
tty_acs_table attribute
tty_features attribute
tty_log_fd attribute
tty_term_codes attribute
tty_terms attribute
utf8_data_tree attribute
UTF8_GET_SIZE constant
UTF8_SET_SIZE constant
colour_byname function
grid_check_y function
grid_clear function
grid_compare function
grid_create function
grid_destroy function
grid_get_cell function
grid_get_line function
grid_reflow function
grid_set_cell function
input_clear function
input_end_bel function
input_free function
input_get function
input_ground function
input_init function
input_input function
input_key function
input_key_cmp function
input_key_get function
input_osc_10 function
input_osc_104 function
input_osc_11 function
input_osc_110 function
input_osc_111 function
input_osc_4 function
input_osc_52 function
input_parse function
input_pending function
input_print function
input_reply function
input_reset function
input_split function
screen_free function
screen_reflow function
screen_reinit function
tty_acs_cmp function
tty_acs_get function
tty_add function
tty_cell function
tty_check_bg function
tty_check_fg function
tty_check_us function
tty_close function
tty_cmd_cell function
tty_cmd_cells function
tty_colours function
tty_cursor function
tty_draw_line function
tty_draw_pane function
tty_fake_bce function
tty_free function
tty_init function
tty_keys_add function
tty_keys_add1 function
tty_keys_find function
tty_keys_free function
tty_keys_next function
tty_margin function
tty_open function
tty_putc function
tty_putcode function
tty_putcode1 function
tty_putcode2 function
tty_putcode3 function
tty_putn function
tty_puts function
tty_raw function
tty_region function
tty_reset function
tty_resize function
tty_set_size function
tty_set_title function
tty_start_tty function
tty_stop_tty function
tty_sync_end function
tty_term_flag function
tty_term_free function
tty_term_has function
tty_term_ptr1 function
tty_term_ptr2 function
tty_write function
utf8_append function
utf8_copy function
utf8_cstrhas function
utf8_data_cmp function
utf8_fromcstr function
utf8_isvalid function
utf8_open function
utf8_padcstr function
utf8_put_item function
utf8_rpadcstr function
utf8_sanitize function
utf8_set function
utf8_stravis function
utf8_stravisx function
utf8_strlen function
utf8_strvis function
utf8_strwidth function
utf8_to_data function
utf8_tocstr function
utf8_width function
Layouts and buffers 2 types, 5 functions and constants
layout_cell struct 10 members
paste_buffer struct 10 members
layout_init function
paste_get_top function
paste_set function
Layouts and buffers — Supporting declarations 5 types, 85 functions and constants
layout_cells struct 2 members
paste_name_tree struct 1 member
paste_time_tree struct 1 member
layout_type enum 3 members
layout_sets attribute
paste_by_name attribute
paste_by_time attribute
layout_append function
layout_assign function
layout_check function
layout_dump function
layout_free function
layout_parse function
layout_resize function
paste_add function
paste_free function
paste_rename function
paste_replace function
paste_walk function
Supporting declarations 58 types, 775 functions and constants
control_block struct 7 members
control_pane struct 11 members
control_panes struct 1 member
control_state struct 10 members
control_sub struct 9 members
control_sub_pane struct 5 members
control_sub_panes struct 1 member
control_sub_window struct 5 members
control_sub_windows struct 1 member
control_subs struct 1 member
job struct 14 members
joblist struct 1 member
key_binding struct 6 members
key_bindings struct 1 member
key_event struct 2 members
key_table struct 6 members
key_tables struct 1 member
menu struct 4 members
menu_data struct 10 members
menu_item struct 3 members
message_entry struct 5 members
message_list struct 2 members
mode_tree_data struct 29 members
mode_tree_item struct 16 members
mode_tree_line struct 4 members
mode_tree_list struct 2 members
mode_tree_menu struct 4 members
mode_tree_sort_criteria struct 2 members
mouse_event struct 18 members
msg_command struct 1 member
msg_read_data struct 1 member
msg_read_done struct 2 members
msg_read_open struct 2 members
msg_write_close struct 1 member
msg_write_data struct 1 member
msg_write_open struct 3 members
msg_write_ready struct 2 members
notify_entry struct 6 members
popup_data struct 20 members
popup_editor struct 3 members
spawn_context struct 13 members
status_line struct 6 members
status_line_entry struct 2 members
status_prompt_menu struct 5 members
style struct 8 members
style_range struct 6 members
style_ranges struct 2 members
tmuxpeer struct 8 members
tmuxproc struct 13 members
anonymous enum enum 193 members
msgtype enum 40 members
style_align enum 5 members
style_list enum 5 members
style_range_type enum 4 members
style_default_type enum 3 members
control_sub_type enum 5 members
key_code type alias
menu_choice_cb type alias
cmdq_cb type alias
prompt_input_cb type alias
prompt_free_cb type alias
overlay_check_cb type alias
overlay_mode_cb type alias
overlay_draw_cb type alias
overlay_key_cb type alias
overlay_free_cb type alias
job_update_cb type alias
job_complete_cb type alias
job_free_cb type alias
mode_tree_key_cb type alias
popup_close_cb type alias
__attribute__ constant
__bounded__ constant
__dead constant
__packed constant
__unused constant
__weak constant
_PATH_BSHELL constant
_PATH_DEFPATH constant
_PATH_DEV constant
_PATH_DEVNULL constant
_PATH_TMP constant
_PATH_TTY constant
_PATH_VI constant
ACCESSPERMS constant
ALERT_ANY constant
ALERT_CURRENT constant
ALERT_NONE constant
ALERT_OTHER constant
alerts_fired attribute
alerts_list attribute
all_jobs attribute
ALL_MODES constant
BSDoptarg attribute
BSDopterr attribute
BSDoptind attribute
BSDoptopt attribute
BSDoptreset attribute
cfg_causes attribute
cfg_client attribute
cfg_files attribute
cfg_finished attribute
cfg_item attribute
cfg_ncauses attribute
cfg_nfiles attribute
cfg_quiet attribute
CLIENT_DEAD constant
CLIENT_EXIT constant
CLIENT_EXITED constant
CLIENT_LOGIN constant
CLIENT_NOFORK constant
CLIENT_REPEAT constant
CLIENT_UTF8 constant
CMD_AFTERHOOK constant
CMD_READONLY constant
CMSG_ALIGN constant
CMSG_LEN constant
CMSG_SPACE constant
ECHOPRT constant
FNM_CASEFOLD constant
FORMAT_FORCE constant
FORMAT_NOJOBS constant
FORMAT_NONE constant
FORMAT_PANE constant
FORMAT_STATUS constant
FORMAT_WINDOW constant
getopt constant
global_environ attribute
global_options attribute
GRID_ATTR_DIM constant
GRID_HISTORY constant
HOST_NAME_MAX constant
IMAXBEL constant
INFTIM constant
JOB_KEEPWRITE constant
JOB_NOWAIT constant
JOB_PTY constant
key_tables attribute
KEYC_BASE constant
KEYC_CTRL constant
KEYC_CURSOR constant
KEYC_IS_MOUSE constant
KEYC_KEYPAD constant
KEYC_LITERAL constant
KEYC_MASK_KEY constant
KEYC_META constant
KEYC_NONE constant
KEYC_NUSER constant
KEYC_SHIFT constant
KEYC_UNKNOWN constant
KEYC_USER constant
log_file attribute
log_level attribute
MENU_NOMOUSE constant
MENU_STAYOPEN constant
MENU_TAB constant
MODE_BLINKING constant
MODE_CRLF constant
MODE_CURSOR constant
MODE_FOCUSON constant
MODE_INSERT constant
MODE_KCURSOR constant
MODE_KKEYPAD constant
MODE_ORIGIN constant
MODE_WRAP constant
MODEKEY_EMACS constant
MODEKEY_VI constant
MOUSE_BUTTONS constant
MOUSE_DRAG constant
MOUSE_RELEASE constant
MOUSE_WHEEL constant
NAME_INTERVAL constant
nitems constant
O_DIRECTORY constant
optarg constant
opterr constant
optind constant
optopt constant
optreset constant
PANE_CHANGED constant
PANE_DROP constant
PANE_EMPTY constant
PANE_EXITED constant
PANE_FOCUSED constant
PANE_INPUTOFF constant
PANE_MINIMUM constant
PANE_REDRAW constant
PEER_BAD constant
pledge constant
printflike constant
PROMPT_KEY constant
PROMPT_SINGLE constant
PROMPT_TARGET constant
PROMPT_WINDOW constant
ptm_fd attribute
shell_command attribute
socket_path attribute
SPAWN_BEFORE constant
SPAWN_EMPTY constant
SPAWN_KILL constant
SPAWN_RESPAWN constant
SPAWN_ZOOM constant
start_time attribute
style_default attribute
SUN_LEN constant
TERM_DECFRA constant
TERM_DECSLRM constant
TERM_NOAM constant
timeradd constant
timercmp constant
timersub constant
TMUX_SOCK constant
TTY_BLOCK constant
TTY_FREEZE constant
TTY_HAVEDA constant
TTY_HAVEXDA constant
TTY_NAME_MAX constant
TTY_NOCURSOR constant
TTY_OPENED constant
TTY_STARTED constant
TTY_SYNCING constant
TTY_TIMER constant
UTF8_SIZE constant
VISUAL_BOTH constant
VISUAL_OFF constant
VISUAL_ON constant
WAIT_ANY constant
WINDOW_BELL constant
WINDOW_RESIZE constant
WINDOW_ZOOMED constant
alerts_queue function
alerts_reset function
alerts_timer function
areshell function
BSDgetopt function
cfg_add_cause function
cfg_done function
checkshell function
control_error function
control_start function
control_stop function
control_write function
err function
errx function
expand_path function
expand_paths function
fatal function
fatalx function
fdforkpty function
fgetln function
file_cmp function
file_error function
file_free function
file_get_path function
file_print function
file_push function
file_push_cb function
file_read function
file_vprint function
file_write function
find_cwd function
find_home function
freezero function
get_timer function
getprogname function
getptmfd function
getshell function
getversion function
job_free function
job_get_data function
job_get_event function
job_kill_all function
job_resize function
job_run function
key_table_cmp function
load_cfg function
log_add_level function
log_close function
log_debug function
log_event_cb function
log_get_level function
log_open function
log_toggle function
log_vwrite function
main function
make_label function
menu_add_item function
menu_create function
menu_display function
menu_draw_cb function
menu_free function
menu_free_cb function
menu_key_cb function
menu_mode_cb function
mode_tree_add function
mode_tree_key function
mode_tree_up function
notify_add function
notify_client function
notify_hook function
notify_pane function
notify_window function
osdep_get_cwd function
popup_display function
popup_draw_cb function
popup_editor function
popup_free_cb function
popup_key_cb function
popup_mode_cb function
proc_add_peer function
proc_event_cb function
proc_exit function
proc_loop function
proc_send function
proc_start function
reallocarray function
recallocarray function
regsub function
regsub_copy function
regsub_expand function
resize_window function
setblocking function
setproctitle function
sig2name function
spawn_log function
spawn_pane function
spawn_window function
start_cfg function
status_free function
status_init function
status_redraw function
strnlen function
strtonum function
style_add function
style_apply function
style_copy function
style_parse function
style_set function
usage function
warn function
warnx function
xasprintf function
xcalloc function
xmalloc function
xrealloc function
xreallocarray function
xsnprintf function
xstrdup function
xstrndup function
xvasprintf function
xvsnprintf function
Esc

Type to search.

Reference previewOpen reference