aboutsummaryrefslogtreecommitdiff
path: root/tmux.h
diff options
context:
space:
mode:
Diffstat (limited to 'tmux.h')
-rw-r--r--tmux.h485
1 files changed, 297 insertions, 188 deletions
diff --git a/tmux.h b/tmux.h
index 3720beee..a1f6d924 100644
--- a/tmux.h
+++ b/tmux.h
@@ -41,9 +41,12 @@ extern char **environ;
struct args;
struct args_value;
struct client;
+struct cmd;
struct cmd_find_state;
struct cmdq_item;
struct cmdq_list;
+struct cmdq_state;
+struct cmds;
struct environ;
struct format_job_tree;
struct format_tree;
@@ -52,9 +55,13 @@ struct job;
struct mode_tree_data;
struct mouse_event;
struct options;
-struct options_entry;
struct options_array_item;
+struct options_entry;
+struct screen_write_collect_item;
+struct screen_write_collect_line;
+struct screen_write_ctx;
struct session;
+struct tty_ctx;
struct tmuxpeer;
struct tmuxproc;
struct winlink;
@@ -62,10 +69,13 @@ struct winlink;
/* Client-server protocol version. */
#define PROTOCOL_VERSION 8
-/* Default configuration files. */
+/* Default configuration files and socket paths. */
#ifndef TMUX_CONF
#define TMUX_CONF "/etc/tmux.conf:~/.tmux.conf"
#endif
+#ifndef TMUX_SOCK
+#define TMUX_SOCK "$TMUX_TMPDIR:" _PATH_TMP
+#endif
/* Minimum layout cell size, NOT including border lines. */
#define PANE_MINIMUM 1
@@ -78,7 +88,7 @@ struct winlink;
#define NAME_INTERVAL 500000
/* Maximum size of data to hold from a pane. */
-#define READ_SIZE 4096
+#define READ_SIZE 8192
/* Default pixel cell sizes. */
#define DEFAULT_XPIXEL 16
@@ -104,24 +114,24 @@ struct winlink;
#define VISUAL_BOTH 2
/* Special key codes. */
-#define KEYC_NONE 0xffff00000000ULL
-#define KEYC_UNKNOWN 0xfffe00000000ULL
-#define KEYC_BASE 0x000010000000ULL
-#define KEYC_USER 0x000020000000ULL
+#define KEYC_NONE 0x00ff000000000ULL
+#define KEYC_UNKNOWN 0x00fe000000000ULL
+#define KEYC_BASE 0x0001000000000ULL
+#define KEYC_USER 0x0002000000000ULL
+
+/* Key modifier bits. */
+#define KEYC_ESCAPE 0x0100000000000ULL
+#define KEYC_CTRL 0x0200000000000ULL
+#define KEYC_SHIFT 0x0400000000000ULL
+#define KEYC_XTERM 0x0800000000000ULL
+#define KEYC_LITERAL 0x1000000000000ULL
/* Available user keys. */
#define KEYC_NUSER 1000
-/* Key modifier bits. */
-#define KEYC_ESCAPE 0x200000000000ULL
-#define KEYC_CTRL 0x400000000000ULL
-#define KEYC_SHIFT 0x800000000000ULL
-#define KEYC_XTERM 0x1000000000000ULL
-#define KEYC_LITERAL 0x2000000000000ULL
-
/* Mask to obtain key w/o modifiers. */
-#define KEYC_MASK_MOD (KEYC_ESCAPE|KEYC_CTRL|KEYC_SHIFT|KEYC_XTERM|KEYC_LITERAL)
-#define KEYC_MASK_KEY (~KEYC_MASK_MOD)
+#define KEYC_MASK_MOD 0xff00000000000ULL
+#define KEYC_MASK_KEY 0x00fffffffffffULL
/* Is this a mouse key? */
#define KEYC_IS_MOUSE(key) (((key) & KEYC_MASK_KEY) >= KEYC_MOUSE && \
@@ -168,6 +178,7 @@ enum {
/* Mouse keys. */
KEYC_MOUSE, /* unclassified mouse event */
KEYC_DRAGGING, /* dragging in progress */
+ KEYC_DOUBLECLICK, /* double click complete */
KEYC_MOUSE_KEY(MOUSEMOVE),
KEYC_MOUSE_KEY(MOUSEDOWN1),
KEYC_MOUSE_KEY(MOUSEDOWN2),
@@ -183,6 +194,9 @@ enum {
KEYC_MOUSE_KEY(MOUSEDRAGEND3),
KEYC_MOUSE_KEY(WHEELUP),
KEYC_MOUSE_KEY(WHEELDOWN),
+ KEYC_MOUSE_KEY(SECONDCLICK1),
+ KEYC_MOUSE_KEY(SECONDCLICK2),
+ KEYC_MOUSE_KEY(SECONDCLICK3),
KEYC_MOUSE_KEY(DOUBLECLICK1),
KEYC_MOUSE_KEY(DOUBLECLICK2),
KEYC_MOUSE_KEY(DOUBLECLICK3),
@@ -249,6 +263,8 @@ enum tty_code_code {
TTYC_BOLD,
TTYC_CIVIS,
TTYC_CLEAR,
+ TTYC_CLMG,
+ TTYC_CMG,
TTYC_CNORM,
TTYC_COLORS,
TTYC_CR,
@@ -269,12 +285,18 @@ enum tty_code_code {
TTYC_DIM,
TTYC_DL,
TTYC_DL1,
+ TTYC_DSBP,
+ TTYC_DSFCS,
+ TTYC_DSMG,
TTYC_E3,
TTYC_ECH,
TTYC_ED,
TTYC_EL,
TTYC_EL1,
TTYC_ENACS,
+ TTYC_ENBP,
+ TTYC_ENFCS,
+ TTYC_ENMG,
TTYC_FSL,
TTYC_HOME,
TTYC_HPA,
@@ -440,19 +462,20 @@ enum tty_code_code {
TTYC_SITM,
TTYC_SMACS,
TTYC_SMCUP,
- TTYC_SMOL,
TTYC_SMKX,
+ TTYC_SMOL,
TTYC_SMSO,
- TTYC_SMULX,
TTYC_SMUL,
+ TTYC_SMULX,
TTYC_SMXX,
TTYC_SS,
+ TTYC_SYNC,
TTYC_TC,
TTYC_TSL,
TTYC_U8,
TTYC_VPA,
TTYC_XENL,
- TTYC_XT,
+ TTYC_XT
};
/* Message codes. */
@@ -468,6 +491,7 @@ enum msgtype {
MSG_IDENTIFY_DONE,
MSG_IDENTIFY_CLIENTPID,
MSG_IDENTIFY_CWD,
+ MSG_IDENTIFY_FEATURES,
MSG_COMMAND = 200,
MSG_DETACH,
@@ -562,6 +586,7 @@ struct msg_write_close {
#define ALL_MODES 0xffffff
#define ALL_MOUSE_MODES (MODE_MOUSE_STANDARD|MODE_MOUSE_BUTTON|MODE_MOUSE_ALL)
+#define MOTION_MOUSE_MODES (MODE_MOUSE_BUTTON|MODE_MOUSE_ALL)
/*
* A single UTF-8 character. UTF8_SIZE must be big enough to hold
@@ -754,20 +779,30 @@ struct screen {
int mode;
- bitstr_t *tabs;
+ u_int saved_cx;
+ u_int saved_cy;
+ struct grid *saved_grid;
+ struct grid_cell saved_cell;
+ int saved_flags;
+ bitstr_t *tabs;
struct screen_sel *sel;
+
+ struct screen_write_collect_line *write_list;
};
/* Screen write context. */
-struct screen_write_collect_item;
-struct screen_write_collect_line;
+typedef void (*screen_write_init_ctx_cb)(struct screen_write_ctx *,
+ struct tty_ctx *);
struct screen_write_ctx {
struct window_pane *wp;
struct screen *s;
+ int sync;
+
+ screen_write_init_ctx_cb init_ctx_cb;
+ void *arg;
struct screen_write_collect_item *item;
- struct screen_write_collect_line *list;
u_int scrolled;
u_int bg;
@@ -810,7 +845,6 @@ struct menu {
u_int width;
};
typedef void (*menu_choice_cb)(struct menu *, u_int, key_code, void *);
-#define MENU_NOMOUSE 0x1
/*
* Window mode. Windows can be in several modes and this is used to call the
@@ -836,11 +870,11 @@ struct window_mode {
void (*formats)(struct window_mode_entry *,
struct format_tree *);
};
-#define WINDOW_MODE_TIMEOUT 180
/* Active window mode. */
struct window_mode_entry {
struct window_pane *wp;
+ struct window_pane *swp;
const struct window_mode *mode;
void *data;
@@ -871,6 +905,9 @@ struct window_pane {
u_int xoff;
u_int yoff;
+ int fg;
+ int bg;
+
int flags;
#define PANE_REDRAW 0x1
#define PANE_DROP 0x2
@@ -898,14 +935,13 @@ struct window_pane {
int fd;
struct bufferevent *event;
- u_int disabled;
struct event resize_timer;
struct input_ctx *ictx;
- struct style cached_style;
- struct style cached_active_style;
+ struct grid_cell cached_gc;
+ struct grid_cell cached_active_gc;
int *palette;
int pipe_fd;
@@ -918,19 +954,17 @@ struct window_pane {
struct screen status_screen;
size_t status_size;
- /* Saved in alternative screen mode. */
- u_int saved_cx;
- u_int saved_cy;
- struct grid *saved_grid;
- struct grid_cell saved_cell;
-
TAILQ_HEAD (, window_mode_entry) modes;
- struct event modetimer;
- time_t modelast;
char *searchstr;
int searchregex;
+ size_t written;
+ size_t skipped;
+
+ int border_gc_set;
+ struct grid_cell border_gc;
+
TAILQ_ENTRY(window_pane) entry;
RB_ENTRY(window_pane) tree_entry;
};
@@ -1048,6 +1082,9 @@ struct environ_entry {
char *name;
char *value;
+ int flags;
+#define ENVIRON_HIDDEN 0x1
+
RB_ENTRY(environ_entry) entry;
};
@@ -1120,6 +1157,7 @@ RB_HEAD(sessions, session);
/* Mouse input. */
struct mouse_event {
int valid;
+ int ignore;
key_code key;
@@ -1165,7 +1203,8 @@ struct tty_key {
struct tty_code;
struct tty_term {
char *name;
- u_int references;
+ struct tty *tty;
+ int features;
char acs[UCHAR_MAX + 1][2];
@@ -1176,6 +1215,7 @@ struct tty_term {
#define TERM_DECSLRM 0x4
#define TERM_DECFRA 0x8
#define TERM_RGBCOLOURS 0x10
+#define TERM_VT100LIKE 0x20
int flags;
LIST_ENTRY(tty_term) entry;
@@ -1221,25 +1261,22 @@ struct tty {
struct termios tio;
struct grid_cell cell;
-
- int last_wp;
struct grid_cell last_cell;
#define TTY_NOCURSOR 0x1
#define TTY_FREEZE 0x2
#define TTY_TIMER 0x4
-#define TTY_UTF8 0x8
+/* 0x8 unused */
#define TTY_STARTED 0x10
#define TTY_OPENED 0x20
#define TTY_FOCUS 0x40
#define TTY_BLOCK 0x80
#define TTY_HAVEDA 0x100
-#define TTY_HAVEDSR 0x200
+#define TTY_HAVEXDA 0x200
+#define TTY_SYNCING 0x400
int flags;
struct tty_term *term;
- char *term_name;
- int term_flags;
u_int mouse_last_x;
u_int mouse_last_y;
@@ -1255,8 +1292,14 @@ struct tty {
};
/* TTY command context. */
+typedef void (*tty_ctx_redraw_cb)(const struct tty_ctx *);
+typedef int (*tty_ctx_set_client_cb)(struct tty_ctx *, struct client *);
struct tty_ctx {
- struct window_pane *wp;
+ struct screen *s;
+
+ tty_ctx_redraw_cb redraw_cb;
+ tty_ctx_set_client_cb set_client_cb;
+ void *arg;
const struct grid_cell *cell;
int wrapped;
@@ -1275,19 +1318,27 @@ struct tty_ctx {
u_int orupper;
u_int orlower;
- /* Pane offset. */
+ /* Target region (usually pane) offset and size. */
u_int xoff;
u_int yoff;
+ u_int rxoff;
+ u_int ryoff;
+ u_int sx;
+ u_int sy;
/* The background colour used for clearing (erasing). */
u_int bg;
- /* Window offset and size. */
+ /* The default colours and palette. */
+ struct grid_cell defaults;
+ int *palette;
+
+ /* Containing region (usually window) offset and size. */
int bigger;
- u_int ox;
- u_int oy;
- u_int sx;
- u_int sy;
+ u_int wox;
+ u_int woy;
+ u_int wsx;
+ u_int wsy;
};
/* Saved message entry. */
@@ -1333,27 +1384,11 @@ struct cmd_find_state {
#define CMD_FIND_EXACT_WINDOW 0x20
#define CMD_FIND_CANFAIL 0x40
-/* Command and list of commands. */
-struct cmd {
- const struct cmd_entry *entry;
- struct args *args;
- u_int group;
-
- char *file;
- u_int line;
-
- char *alias;
- int argc;
- char **argv;
-
- TAILQ_ENTRY(cmd) qentry;
-};
-TAILQ_HEAD(cmds, cmd);
-
+/* List of commands. */
struct cmd_list {
- int references;
- u_int group;
- struct cmds list;
+ int references;
+ u_int group;
+ struct cmds *list;
};
/* Command return values. */
@@ -1381,6 +1416,7 @@ struct cmd_parse_input {
#define CMD_PARSE_PARSEONLY 0x2
#define CMD_PARSE_NOALIAS 0x4
#define CMD_PARSE_VERBOSE 0x8
+#define CMD_PARSE_ONEGROUP 0x10
const char *file;
u_int line;
@@ -1390,59 +1426,13 @@ struct cmd_parse_input {
struct cmd_find_state fs;
};
-/* Command queue item type. */
-enum cmdq_type {
- CMDQ_COMMAND,
- CMDQ_CALLBACK,
-};
-
-/* Command queue item shared state. */
-struct cmdq_shared {
- int references;
-
- int flags;
-#define CMDQ_SHARED_REPEAT 0x1
-#define CMDQ_SHARED_CONTROL 0x2
-
- struct format_tree *formats;
-
- struct mouse_event mouse;
- struct cmd_find_state current;
-};
+/* Command queue flags. */
+#define CMDQ_STATE_REPEAT 0x1
+#define CMDQ_STATE_CONTROL 0x2
+#define CMDQ_STATE_NOHOOKS 0x4
-/* Command queue item. */
+/* Command queue callback. */
typedef enum cmd_retval (*cmdq_cb) (struct cmdq_item *, void *);
-struct cmdq_item {
- char *name;
- struct cmdq_list *queue;
- struct cmdq_item *next;
-
- struct client *client;
-
- enum cmdq_type type;
- u_int group;
-
- u_int number;
- time_t time;
-
- int flags;
-#define CMDQ_FIRED 0x1
-#define CMDQ_WAITING 0x2
-#define CMDQ_NOHOOKS 0x4
-
- struct cmdq_shared *shared;
- struct cmd_find_state source;
- struct cmd_find_state target;
-
- struct cmd_list *cmdlist;
- struct cmd *cmd;
-
- cmdq_cb cb;
- void *data;
-
- TAILQ_ENTRY(cmdq_item) entry;
-};
-TAILQ_HEAD(cmdq_list, cmdq_item);
/* Command definition flag. */
struct cmd_entry_flag {
@@ -1469,6 +1459,9 @@ struct cmd_entry {
#define CMD_STARTSERVER 0x1
#define CMD_READONLY 0x2
#define CMD_AFTERHOOK 0x4
+#define CMD_CLIENT_CFLAG 0x8
+#define CMD_CLIENT_TFLAG 0x10
+#define CMD_CLIENT_CANFAIL 0x20
int flags;
enum cmd_retval (*exec)(struct cmd *, struct cmdq_item *);
@@ -1517,13 +1510,15 @@ RB_HEAD(client_files, client_file);
/* Client connection. */
typedef int (*prompt_input_cb)(struct client *, void *, const char *, int);
typedef void (*prompt_free_cb)(void *);
+typedef int (*overlay_check_cb)(struct client *, u_int, u_int);
+typedef struct screen *(*overlay_mode_cb)(struct client *, u_int *, u_int *);
typedef void (*overlay_draw_cb)(struct client *, struct screen_redraw_ctx *);
typedef int (*overlay_key_cb)(struct client *, struct key_event *);
typedef void (*overlay_free_cb)(struct client *);
struct client {
const char *name;
struct tmuxpeer *peer;
- struct cmdq_list queue;
+ struct cmdq_list *queue;
pid_t pid;
int fd;
@@ -1539,7 +1534,10 @@ struct client {
char *title;
const char *cwd;
- char *term;
+ char *term_name;
+ int term_features;
+ char *term_type;
+
char *ttyname;
struct tty tty;
@@ -1551,6 +1549,7 @@ struct client {
struct event click_timer;
u_int click_button;
+ struct mouse_event click_event;
struct status_line status;
@@ -1571,7 +1570,7 @@ struct client {
#define CLIENT_CONTROLCONTROL 0x4000
#define CLIENT_FOCUSED 0x8000
#define CLIENT_UTF8 0x10000
-#define CLIENT_256COLOURS 0x20000
+/* 0x20000 unused */
#define CLIENT_IDENTIFIED 0x40000
#define CLIENT_STATUSFORCE 0x80000
#define CLIENT_DOUBLECLICK 0x100000
@@ -1581,12 +1580,16 @@ struct client {
#define CLIENT_REDRAWSTATUSALWAYS 0x1000000
#define CLIENT_REDRAWOVERLAY 0x2000000
#define CLIENT_CONTROL_NOOUTPUT 0x4000000
+#define CLIENT_DEFAULTSOCKET 0x8000000
+#define CLIENT_STARTSERVER 0x10000000
+#define CLIENT_REDRAWPANES 0x20000000
#define CLIENT_ALLREDRAWFLAGS \
(CLIENT_REDRAWWINDOW| \
CLIENT_REDRAWSTATUS| \
CLIENT_REDRAWSTATUSALWAYS| \
CLIENT_REDRAWBORDERS| \
- CLIENT_REDRAWOVERLAY)
+ CLIENT_REDRAWOVERLAY| \
+ CLIENT_REDRAWPANES)
#define CLIENT_UNATTACHEDFLAGS \
(CLIENT_DEAD| \
CLIENT_SUSPENDED| \
@@ -1598,6 +1601,8 @@ struct client {
int flags;
struct key_table *keytable;
+ uint64_t redraw_panes;
+
char *message_string;
struct event message_timer;
u_int message_next;
@@ -1618,6 +1623,8 @@ struct client {
#define PROMPT_INCREMENTAL 0x4
#define PROMPT_NOFORMAT 0x8
#define PROMPT_KEY 0x10
+#define PROMPT_WINDOW 0x20
+#define PROMPT_TARGET 0x40
int prompt_flags;
struct session *session;
@@ -1629,6 +1636,8 @@ struct client {
u_int pan_ox;
u_int pan_oy;
+ overlay_check_cb overlay_check;
+ overlay_mode_cb overlay_mode;
overlay_draw_cb overlay_draw;
overlay_key_cb overlay_key;
overlay_free_cb overlay_free;
@@ -1682,7 +1691,6 @@ enum options_table_type {
OPTIONS_TABLE_COLOUR,
OPTIONS_TABLE_FLAG,
OPTIONS_TABLE_CHOICE,
- OPTIONS_TABLE_STYLE,
OPTIONS_TABLE_COMMAND
};
@@ -1694,12 +1702,13 @@ enum options_table_type {
#define OPTIONS_TABLE_IS_ARRAY 0x1
#define OPTIONS_TABLE_IS_HOOK 0x2
+#define OPTIONS_TABLE_IS_STYLE 0x4
struct options_table_entry {
const char *name;
enum options_table_type type;
int scope;
- int flags;
+ int flags;
u_int minimum;
u_int maximum;
@@ -1730,7 +1739,7 @@ struct spawn_context {
struct session *s;
struct winlink *wl;
- struct client *c;
+ struct client *tc;
struct window_pane *wp0;
struct layout_cell *lc;
@@ -1738,7 +1747,7 @@ struct spawn_context {
const char *name;
char **argv;
int argc;
- struct environ *environ;
+ struct environ *environ;
int idx;
const char *cwd;
@@ -1769,11 +1778,14 @@ extern const char *socket_path;
extern const char *shell_command;
extern int ptm_fd;
extern const char *shell_command;
-int areshell(const char *);
+int checkshell(const char *);
void setblocking(int, int);
+const char *sig2name(int);
const char *find_cwd(void);
const char *find_home(void);
const char *getversion(void);
+void expand_paths(const char *, char ***, u_int *);
+
/* proc.c */
struct imsg;
@@ -1815,6 +1827,7 @@ void paste_free(struct paste_buffer *);
void paste_add(const char *, char *, size_t);
int paste_rename(const char *, const char *, char **);
int paste_set(char *, size_t, const char *, char **);
+void paste_replace(struct paste_buffer *, char *, size_t);
char *paste_make_sample(struct paste_buffer *);
/* format.c */
@@ -1826,11 +1839,13 @@ char *paste_make_sample(struct paste_buffer *);
#define FORMAT_PANE 0x80000000U
#define FORMAT_WINDOW 0x40000000U
struct format_tree;
+struct format_modifier;
const char *format_skip(const char *, const char *);
int format_true(const char *);
struct format_tree *format_create(struct client *, struct cmdq_item *, int,
int);
void format_free(struct format_tree *);
+void format_merge(struct format_tree *, struct format_tree *);
void printflike(3, 4) format_add(struct format_tree *, const char *,
const char *, ...);
void format_each(struct format_tree *, void (*)(const char *,
@@ -1840,6 +1855,14 @@ char *format_expand(struct format_tree *, const char *);
char *format_single(struct cmdq_item *, const char *,
struct client *, struct session *, struct winlink *,
struct window_pane *);
+char *format_single_from_state(struct cmdq_item *, const char *,
+ struct client *, struct cmd_find_state *);
+char *format_single_from_target(struct cmdq_item *, const char *);
+struct format_tree *format_create_defaults(struct cmdq_item *, struct client *,
+ struct session *, struct winlink *, struct window_pane *);
+struct format_tree *format_create_from_state(struct cmdq_item *,
+ struct client *, struct cmd_find_state *);
+struct format_tree *format_create_from_target(struct cmdq_item *);
void format_defaults(struct format_tree *, struct client *,
struct session *, struct winlink *, struct window_pane *);
void format_defaults_window(struct format_tree *, struct window *);
@@ -1905,18 +1928,17 @@ struct options_entry *options_match_get(struct options *, const char *, int *,
int, int *);
const char *options_get_string(struct options *, const char *);
long long options_get_number(struct options *, const char *);
-struct style *options_get_style(struct options *, const char *);
struct options_entry * printflike(4, 5) options_set_string(struct options *,
const char *, int, const char *, ...);
struct options_entry *options_set_number(struct options *, const char *,
long long);
-struct options_entry *options_set_style(struct options *, const char *, int,
- const char *);
int options_scope_from_name(struct args *, int,
const char *, struct cmd_find_state *, struct options **,
char **);
int options_scope_from_flags(struct args *, int,
struct cmd_find_state *, struct options **, char **);
+struct style *options_string_to_style(struct options *, const char *,
+ struct format_tree *);
/* options-table.c */
extern const struct options_table_entry options_table[];
@@ -1926,9 +1948,13 @@ typedef void (*job_update_cb) (struct job *);
typedef void (*job_complete_cb) (struct job *);
typedef void (*job_free_cb) (void *);
#define JOB_NOWAIT 0x1
+#define JOB_KEEPWRITE 0x2
+#define JOB_PTY 0x4
struct job *job_run(const char *, struct session *, const char *,
- job_update_cb, job_complete_cb, job_free_cb, void *, int);
+ job_update_cb, job_complete_cb, job_free_cb, void *, int,
+ int, int);
void job_free(struct job *);
+void job_resize(struct job *, u_int, u_int);
void job_check_died(pid_t, int);
int job_get_status(struct job *);
void *job_get_data(struct job *);
@@ -1944,10 +1970,10 @@ struct environ_entry *environ_first(struct environ *);
struct environ_entry *environ_next(struct environ_entry *);
void environ_copy(struct environ *, struct environ *);
struct environ_entry *environ_find(struct environ *, const char *);
-void printflike(3, 4) environ_set(struct environ *, const char *, const char *,
- ...);
+void printflike(4, 5) environ_set(struct environ *, const char *, int,
+ const char *, ...);
void environ_clear(struct environ *, const char *);
-void environ_put(struct environ *, const char *);
+void environ_put(struct environ *, const char *, int);
void environ_unset(struct environ *, const char *);
void environ_update(struct options *, struct environ *, struct environ *);
void environ_push(struct environ *);
@@ -1962,7 +1988,7 @@ void tty_update_window_offset(struct window *);
void tty_update_client_offset(struct client *);
void tty_raw(struct tty *, const char *);
void tty_attributes(struct tty *, const struct grid_cell *,
- struct window_pane *);
+ const struct grid_cell *, int *);
void tty_reset(struct tty *);
void tty_region_off(struct tty *);
void tty_margin_off(struct tty *);
@@ -1977,19 +2003,22 @@ void tty_putcode_ptr2(struct tty *, enum tty_code_code, const void *,
void tty_puts(struct tty *, const char *);
void tty_putc(struct tty *, u_char);
void tty_putn(struct tty *, const void *, size_t, u_int);
-int tty_init(struct tty *, struct client *, int, char *);
+int tty_init(struct tty *, struct client *, int);
void tty_resize(struct tty *);
void tty_set_size(struct tty *, u_int, u_int, u_int, u_int);
void tty_start_tty(struct tty *);
+void tty_send_requests(struct tty *);
void tty_stop_tty(struct tty *);
void tty_set_title(struct tty *, const char *);
void tty_update_mode(struct tty *, int, struct screen *);
-void tty_draw_line(struct tty *, struct window_pane *, struct screen *,
- u_int, u_int, u_int, u_int, u_int);
+void tty_draw_line(struct tty *, struct screen *, u_int, u_int, u_int,
+ u_int, u_int, const struct grid_cell *, int *);
+void tty_sync_start(struct tty *);
+void tty_sync_end(struct tty *);
int tty_open(struct tty *, char **);
void tty_close(struct tty *);
void tty_free(struct tty *);
-void tty_set_flags(struct tty *, int);
+void tty_update_features(struct tty *);
void tty_write(void (*)(struct tty *, const struct tty_ctx *),
struct tty_ctx *);
void tty_cmd_alignmenttest(struct tty *, const struct tty_ctx *);
@@ -2013,11 +2042,15 @@ void tty_cmd_scrolldown(struct tty *, const struct tty_ctx *);
void tty_cmd_reverseindex(struct tty *, const struct tty_ctx *);
void tty_cmd_setselection(struct tty *, const struct tty_ctx *);
void tty_cmd_rawstring(struct tty *, const struct tty_ctx *);
+void tty_cmd_syncstart(struct tty *, const struct tty_ctx *);
+void tty_default_colours(struct grid_cell *, struct window_pane *);
/* tty-term.c */
extern struct tty_terms tty_terms;
u_int tty_term_ncodes(void);
-struct tty_term *tty_term_find(char *, int, char **);
+void tty_term_apply(struct tty_term *, const char *, int);
+void tty_term_apply_overrides(struct tty_term *);
+struct tty_term *tty_term_create(struct tty *, char *, int *, int, char **);
void tty_term_free(struct tty_term *);
int tty_term_has(struct tty_term *, enum tty_code_code);
const char *tty_term_string(struct tty_term *, enum tty_code_code);
@@ -2034,6 +2067,12 @@ int tty_term_number(struct tty_term *, enum tty_code_code);
int tty_term_flag(struct tty_term *, enum tty_code_code);
const char *tty_term_describe(struct tty_term *, enum tty_code_code);
+/* tty-features.c */
+void tty_add_features(int *, const char *, const char *);
+const char *tty_get_features(int);
+int tty_apply_features(struct tty_term *, int);
+void tty_default_features(int *, const char *, u_int);
+
/* tty-acs.c */
int tty_acs_needed(struct tty *);
const char *tty_acs_get(struct tty *, u_char);
@@ -2055,6 +2094,10 @@ const char *args_first_value(struct args *, u_char, struct args_value **);
const char *args_next_value(struct args_value **);
long long args_strtonum(struct args *, u_char, long long, long long,
char **);
+long long args_percentage(struct args *, u_char, long long,
+ long long, long long, char **);
+long long args_string_percentage(const char *, long long, long long,
+ long long, char **);
/* cmd-find.c */
int cmd_find_target(struct cmd_find_state *, struct cmdq_item *,
@@ -2085,6 +2128,7 @@ int cmd_find_from_mouse(struct cmd_find_state *,
int cmd_find_from_nothing(struct cmd_find_state *, int);
/* cmd.c */
+extern const struct cmd_entry *cmd_table[];
void printflike(3, 4) cmd_log_argv(int, char **, const char *, ...);
void cmd_prepend_argv(int *, char ***, char *);
void cmd_append_argv(int *, char ***, char *);
@@ -2094,41 +2138,70 @@ char **cmd_copy_argv(int, char **);
void cmd_free_argv(int, char **);
char *cmd_stringify_argv(int, char **);
char *cmd_get_alias(const char *);
+const struct cmd_entry *cmd_get_entry(struct cmd *);
+struct args *cmd_get_args(struct cmd *);
+u_int cmd_get_group(struct cmd *);
+void cmd_get_source(struct cmd *, const char **, u_int *);
struct cmd *cmd_parse(int, char **, const char *, u_int, char **);
void cmd_free(struct cmd *);
char *cmd_print(struct cmd *);
+struct cmd_list *cmd_list_new(void);
+void cmd_list_append(struct cmd_list *, struct cmd *);
+void cmd_list_move(struct cmd_list *, struct cmd_list *);
+void cmd_list_free(struct cmd_list *);
+char *cmd_list_print(struct cmd_list *, int);
+struct cmd *cmd_list_first(struct cmd_list *);
+struct cmd *cmd_list_next(struct cmd *);
+int cmd_list_all_have(struct cmd_list *, int);
+int cmd_list_any_have(struct cmd_list *, int);
int cmd_mouse_at(struct window_pane *, struct mouse_event *,
u_int *, u_int *, int);
struct winlink *cmd_mouse_window(struct mouse_event *, struct session **);
struct window_pane *cmd_mouse_pane(struct mouse_event *, struct session **,
struct winlink **);
char *cmd_template_replace(const char *, const char *, int);
-extern const struct cmd_entry *cmd_table[];
/* cmd-attach-session.c */
enum cmd_retval cmd_attach_session(struct cmdq_item *, const char *, int, int,
int, const char *, int);
/* cmd-parse.c */
-void cmd_parse_empty(struct cmd_parse_input *);
+void cmd_parse_empty(struct cmd_parse_input *);
struct cmd_parse_result *cmd_parse_from_file(FILE *, struct cmd_parse_input *);
struct cmd_parse_result *cmd_parse_from_string(const char *,
struct cmd_parse_input *);
+enum cmd_parse_status cmd_parse_and_insert(const char *,
+ struct cmd_parse_input *, struct cmdq_item *,
+ struct cmdq_state *, char **);
+enum cmd_parse_status cmd_parse_and_append(const char *,
+ struct cmd_parse_input *, struct client *,
+ struct cmdq_state *, char **);
struct cmd_parse_result *cmd_parse_from_buffer(const void *, size_t,
struct cmd_parse_input *);
struct cmd_parse_result *cmd_parse_from_arguments(int, char **,
struct cmd_parse_input *);
-/* cmd-list.c */
-struct cmd_list *cmd_list_new(void);
-void cmd_list_append(struct cmd_list *, struct cmd *);
-void cmd_list_move(struct cmd_list *, struct cmd_list *);
-void cmd_list_free(struct cmd_list *);
-char *cmd_list_print(struct cmd_list *, int);
-
/* cmd-queue.c */
-struct cmdq_item *cmdq_get_command(struct cmd_list *, struct cmd_find_state *,
- struct mouse_event *, int);
+struct cmdq_state *cmdq_new_state(struct cmd_find_state *, struct key_event *,
+ int);
+struct cmdq_state *cmdq_link_state(struct cmdq_state *);
+struct cmdq_state *cmdq_copy_state(struct cmdq_state *);
+void cmdq_free_state(struct cmdq_state *);
+void printflike(3, 4) cmdq_add_format(struct cmdq_state *, const char *,
+ const char *, ...);
+void cmdq_merge_formats(struct cmdq_item *, struct format_tree *);
+struct cmdq_list *cmdq_new(void);
+void cmdq_free(struct cmdq_list *);
+const char *cmdq_get_name(struct cmdq_item *);
+struct client *cmdq_get_client(struct cmdq_item *);
+struct client *cmdq_get_target_client(struct cmdq_item *);
+struct cmdq_state *cmdq_get_state(struct cmdq_item *);
+struct cmd_find_state *cmdq_get_target(struct cmdq_item *);
+struct cmd_find_state *cmdq_get_source(struct cmdq_item *);
+struct key_event *cmdq_get_event(struct cmdq_item *);
+struct cmd_find_state *cmdq_get_current(struct cmdq_item *);
+int cmdq_get_flags(struct cmdq_item *);
+struct cmdq_item *cmdq_get_command(struct cmd_list *, struct cmdq_state *);
#define cmdq_get_callback(cb, data) cmdq_get_callback1(#cb, cb, data)
struct cmdq_item *cmdq_get_callback1(const char *, cmdq_cb, void *);
struct cmdq_item *cmdq_get_error(const char *);
@@ -2137,9 +2210,8 @@ struct cmdq_item *cmdq_append(struct client *, struct cmdq_item *);
void cmdq_insert_hook(struct session *, struct cmdq_item *,
struct cmd_find_state *, const char *, ...);
void cmdq_continue(struct cmdq_item *);
-void printflike(3, 4) cmdq_format(struct cmdq_item *, const char *,
- const char *, ...);
u_int cmdq_next(struct client *);
+struct cmdq_item *cmdq_running(struct client *);
void cmdq_guard(struct cmdq_item *, const char *, int);
void printflike(2, 3) cmdq_print(struct cmdq_item *, const char *, ...);
void printflike(2, 3) cmdq_error(struct cmdq_item *, const char *, ...);
@@ -2148,7 +2220,7 @@ void printflike(2, 3) cmdq_error(struct cmdq_item *, const char *, ...);
void cmd_wait_for_flush(void);
/* client.c */
-int client_main(struct event_base *, int, char **, int);
+int client_main(struct event_base *, int, char **, int, int);
/* key-bindings.c */
struct key_table *key_bindings_get_table(const char *, int);
@@ -2164,7 +2236,7 @@ void key_bindings_remove(const char *, key_code);
void key_bindings_remove_table(const char *);
void key_bindings_init(void);
struct cmdq_item *key_bindings_dispatch(struct key_binding *,
- struct cmdq_item *, struct client *, struct mouse_event *,
+ struct cmdq_item *, struct client *, struct key_event *,
struct cmd_find_state *);
/* key-string.c */
@@ -2185,8 +2257,8 @@ void file_fire_done(struct client_file *);
void file_fire_read(struct client_file *);
int file_can_print(struct client *);
void printflike(2, 3) file_print(struct client *, const char *, ...);
-void file_vprint(struct client *, const char *, va_list);
-void file_print_buffer(struct client *, void *, size_t);
+void file_vprint(struct client *, const char *, va_list);
+void file_print_buffer(struct client *, void *, size_t);
void printflike(2, 3) file_error(struct client *, const char *, ...);
void file_write(struct client *, const char *, int, const void *, size_t,
client_file_cb, void *);
@@ -2203,14 +2275,16 @@ void server_clear_marked(void);
int server_is_marked(struct session *, struct winlink *,
struct window_pane *);
int server_check_marked(void);
-int server_start(struct tmuxproc *, struct event_base *, int, char *);
+int server_start(struct tmuxproc *, int, struct event_base *, int, char *);
void server_update_socket(void);
void server_add_accept(int);
/* server-client.c */
u_int server_client_how_many(void);
-void server_client_set_overlay(struct client *, u_int, overlay_draw_cb,
- overlay_key_cb, overlay_free_cb, void *);
+void server_client_set_overlay(struct client *, u_int, overlay_check_cb,
+ overlay_mode_cb, overlay_draw_cb, overlay_key_cb,
+ overlay_free_cb, void *);
+void server_client_clear_overlay(struct client *);
void server_client_set_key_table(struct client *, const char *);
const char *server_client_get_key_table(struct client *);
int server_client_check_nested(struct client *);
@@ -2282,15 +2356,21 @@ void recalculate_size(struct window *);
void recalculate_sizes(void);
/* input.c */
-void input_init(struct window_pane *);
-void input_free(struct window_pane *);
-void input_reset(struct window_pane *, int);
-struct evbuffer *input_pending(struct window_pane *);
-void input_parse(struct window_pane *);
+struct input_ctx *input_init(struct window_pane *, struct bufferevent *);
+void input_free(struct input_ctx *);
+void input_reset(struct input_ctx *, int);
+struct evbuffer *input_pending(struct input_ctx *);
+void input_parse_pane(struct window_pane *);
void input_parse_buffer(struct window_pane *, u_char *, size_t);
+void input_parse_screen(struct input_ctx *, struct screen *,
+ screen_write_init_ctx_cb, void *, u_char *, size_t);
/* input-key.c */
-int input_key(struct window_pane *, key_code, struct mouse_event *);
+int input_key_pane(struct window_pane *, key_code, struct mouse_event *);
+int input_key(struct window_pane *, struct screen *, struct bufferevent *,
+ key_code);
+int input_key_get_mouse(struct screen *, struct mouse_event *, u_int,
+ u_int, const char **, size_t *);
/* xterm-keys.c */
char *xterm_keys_lookup(key_code);
@@ -2311,11 +2391,15 @@ int attributes_fromstring(const char *);
/* grid.c */
extern const struct grid_cell grid_default_cell;
+void grid_empty_line(struct grid *, u_int, u_int);
int grid_cells_equal(const struct grid_cell *, const struct grid_cell *);
+int grid_cells_look_equal(const struct grid_cell *,
+ const struct grid_cell *);
struct grid *grid_create(u_int, u_int, u_int);
void grid_destroy(struct grid *);
int grid_compare(struct grid *, struct grid *);
void grid_collect_history(struct grid *);
+void grid_remove_history(struct grid *, u_int );
void grid_scroll_history(struct grid *, u_int);
void grid_scroll_history_region(struct grid *, u_int, u_int, u_int);
void grid_clear_history(struct grid *);
@@ -2360,8 +2444,13 @@ void grid_view_delete_cells(struct grid *, u_int, u_int, u_int, u_int);
char *grid_view_string_cells(struct grid *, u_int, u_int, u_int);
/* screen-write.c */
-void screen_write_start(struct screen_write_ctx *, struct window_pane *,
- struct screen *);
+void screen_write_make_list(struct screen *);
+void screen_write_free_list(struct screen *);
+void screen_write_start_pane(struct screen_write_ctx *,
+ struct window_pane *, struct screen *);
+void screen_write_start(struct screen_write_ctx *, struct screen *);
+void screen_write_start_callback(struct screen_write_ctx *, struct screen *,
+ screen_write_init_ctx_cb, void *);
void screen_write_stop(struct screen_write_ctx *);
void screen_write_reset(struct screen_write_ctx *);
size_t printflike(1, 2) screen_write_strlen(const char *, ...);
@@ -2373,13 +2462,12 @@ void screen_write_vnputs(struct screen_write_ctx *, ssize_t,
const struct grid_cell *, const char *, va_list);
void screen_write_putc(struct screen_write_ctx *, const struct grid_cell *,
u_char);
-void screen_write_copy(struct screen_write_ctx *, struct screen *, u_int,
- u_int, u_int, u_int, bitstr_t *, const struct grid_cell *);
void screen_write_fast_copy(struct screen_write_ctx *, struct screen *,
u_int, u_int, u_int, u_int);
void screen_write_hline(struct screen_write_ctx *, u_int, int, int);
void screen_write_vline(struct screen_write_ctx *, u_int, int, int);
-void screen_write_menu(struct screen_write_ctx *, struct menu *, int);
+void screen_write_menu(struct screen_write_ctx *, struct menu *, int,
+ const struct grid_cell *);
void screen_write_box(struct screen_write_ctx *, u_int, u_int);
void screen_write_preview(struct screen_write_ctx *, struct screen *, u_int,
u_int);
@@ -2416,6 +2504,10 @@ void screen_write_collect_add(struct screen_write_ctx *,
void screen_write_cell(struct screen_write_ctx *, const struct grid_cell *);
void screen_write_setselection(struct screen_write_ctx *, u_char *, u_int);
void screen_write_rawstring(struct screen_write_ctx *, u_char *, u_int);
+void screen_write_alternateon(struct screen_write_ctx *,
+ struct grid_cell *, int);
+void screen_write_alternateoff(struct screen_write_ctx *,
+ struct grid_cell *, int);
/* screen-redraw.c */
void screen_redraw_screen(struct client *);
@@ -2433,6 +2525,8 @@ void screen_set_path(struct screen *, const char *);
void screen_push_title(struct screen *);
void screen_pop_title(struct screen *);
void screen_resize(struct screen *, u_int, u_int, int);
+void screen_resize_cursor(struct screen *, u_int, u_int, int, int, u_int *,
+ u_int *);
void screen_set_selection(struct screen *, u_int, u_int, u_int, u_int,
u_int, int, struct grid_cell *);
void screen_clear_selection(struct screen *);
@@ -2440,6 +2534,8 @@ void screen_hide_selection(struct screen *);
int screen_check_selection(struct screen *, u_int, u_int);
void screen_select_cell(struct screen *, struct grid_cell *,
const struct grid_cell *);
+void screen_alternate_on(struct screen *, struct grid_cell *, int);
+void screen_alternate_off(struct screen *, struct grid_cell *, int);
/* window.c */
extern struct windows windows;
@@ -2500,17 +2596,13 @@ struct window_pane *window_pane_find_by_id_str(const char *);
struct window_pane *window_pane_find_by_id(u_int);
int window_pane_destroy_ready(struct window_pane *);
void window_pane_resize(struct window_pane *, u_int, u_int);
-void window_pane_alternate_on(struct window_pane *,
- struct grid_cell *, int);
-void window_pane_alternate_off(struct window_pane *,
- struct grid_cell *, int);
void window_pane_set_palette(struct window_pane *, u_int, int);
void window_pane_unset_palette(struct window_pane *, u_int);
void window_pane_reset_palette(struct window_pane *);
int window_pane_get_palette(struct window_pane *, int);
int window_pane_set_mode(struct window_pane *,
- const struct window_mode *, struct cmd_find_state *,
- struct args *);
+ struct window_pane *, const struct window_mode *,
+ struct cmd_find_state *, struct args *);
void window_pane_reset_mode(struct window_pane *);
void window_pane_reset_mode_all(struct window_pane *);
int window_pane_key(struct window_pane *, struct client *,
@@ -2585,7 +2677,8 @@ typedef void (*mode_tree_each_cb)(void *, void *, struct client *, key_code);
u_int mode_tree_count_tagged(struct mode_tree_data *);
void *mode_tree_get_current(struct mode_tree_data *);
void mode_tree_expand_current(struct mode_tree_data *);
-void mode_tree_set_current(struct mode_tree_data *, uint64_t);
+void mode_tree_expand(struct mode_tree_data *, uint64_t);
+int mode_tree_set_current(struct mode_tree_data *, uint64_t);
void mode_tree_each_tagged(struct mode_tree_data *, mode_tree_each_cb,
struct client *, key_code, int);
void mode_tree_down(struct mode_tree_data *, int);
@@ -2627,6 +2720,8 @@ void printflike(2, 3) window_copy_add(struct window_pane *, const char *, ...);
void window_copy_vadd(struct window_pane *, const char *, va_list);
void window_copy_pageup(struct window_pane *, int);
void window_copy_start_drag(struct client *, struct mouse_event *);
+char *window_copy_get_word(struct window_pane *, u_int, u_int);
+char *window_copy_get_line(struct window_pane *, u_int);
/* names.c */
void check_window_name(struct window *);
@@ -2662,10 +2757,10 @@ struct session *session_find_by_id_str(const char *);
struct session *session_find_by_id(u_int);
struct session *session_create(const char *, const char *, const char *,
struct environ *, struct options *, struct termios *);
-void session_destroy(struct session *, int, const char *);
+void session_destroy(struct session *, int, const char *);
void session_add_ref(struct session *, const char *);
void session_remove_ref(struct session *, const char *);
-int session_check_name(const char *);
+char *session_check_name(const char *);
void session_update_activity(struct session *, struct timeval *);
struct session *session_next_session(struct session *);
struct session *session_previous_session(struct session *);
@@ -2727,29 +2822,43 @@ __dead void printflike(1, 2) fatal(const char *, ...);
__dead void printflike(1, 2) fatalx(const char *, ...);
/* menu.c */
+#define MENU_NOMOUSE 0x1
+#define MENU_TAB 0x2
struct menu *menu_create(const char *);
void menu_add_items(struct menu *, const struct menu_item *,
struct cmdq_item *, struct client *,
struct cmd_find_state *);
-void menu_add_item(struct menu *, const struct menu_item *,
+void menu_add_item(struct menu *, const struct menu_item *,
struct cmdq_item *, struct client *,
struct cmd_find_state *);
-
void menu_free(struct menu *);
int menu_display(struct menu *, int, struct cmdq_item *, u_int,
u_int, struct client *, struct cmd_find_state *,
menu_choice_cb, void *);
+/* popup.c */
+#define POPUP_WRITEKEYS 0x1
+#define POPUP_CLOSEEXIT 0x2
+#define POPUP_CLOSEEXITZERO 0x4
+typedef void (*popup_close_cb)(int, void *);
+u_int popup_width(struct cmdq_item *, u_int, const char **,
+ struct client *, struct cmd_find_state *);
+u_int popup_height(u_int, const char **);
+int popup_display(int, struct cmdq_item *, u_int, u_int, u_int,
+ u_int, u_int, const char **, const char *, const char *,
+ const char *, struct client *, struct cmd_find_state *,
+ popup_close_cb, void *);
+
/* style.c */
int style_parse(struct style *,const struct grid_cell *,
const char *);
const char *style_tostring(struct style *);
+void style_add(struct grid_cell *, struct options *,
+ const char *, struct format_tree *);
void style_apply(struct grid_cell *, struct options *,
- const char *);
-int style_equal(struct style *, struct style *);
+ const char *, struct format_tree *);
void style_set(struct style *, const struct grid_cell *);
void style_copy(struct style *, struct style *);
-int style_is_default(struct style *);
/* spawn.c */
struct winlink *spawn_window(struct spawn_context *, char **);