mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		
							
								
								
									
										2
									
								
								cfg.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								cfg.c
									
									
									
									
									
								
							@@ -122,7 +122,7 @@ load_cfg(const char *path, struct client *c, struct cmdq_item *item, int quiet)
 | 
				
			|||||||
				    line);
 | 
									    line);
 | 
				
			||||||
				continue;
 | 
									continue;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			ft = format_create(NULL, FORMAT_NOJOBS);
 | 
								ft = format_create(NULL, FORMAT_NONE, FORMAT_NOJOBS);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			s = p + 3;
 | 
								s = p + 3;
 | 
				
			||||||
			while (isspace((u_char)*s))
 | 
								while (isspace((u_char)*s))
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -77,7 +77,7 @@ cmd_attach_session(struct cmdq_item *item, int dflag, int rflag,
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (cflag != NULL) {
 | 
						if (cflag != NULL) {
 | 
				
			||||||
		ft = format_create(item, 0);
 | 
							ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
		format_defaults(ft, c, s, wl, wp);
 | 
							format_defaults(ft, c, s, wl, wp);
 | 
				
			||||||
		cwd = format_expand(ft, cflag);
 | 
							cwd = format_expand(ft, cflag);
 | 
				
			||||||
		format_free(ft);
 | 
							format_free(ft);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -107,7 +107,7 @@ cmd_break_pane_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
		if ((template = args_get(args, 'F')) == NULL)
 | 
							if ((template = args_get(args, 'F')) == NULL)
 | 
				
			||||||
			template = BREAK_PANE_TEMPLATE;
 | 
								template = BREAK_PANE_TEMPLATE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ft = format_create(item, 0);
 | 
							ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
		format_defaults(ft, item->state.c, dst_s, wl, wp);
 | 
							format_defaults(ft, item->state.c, dst_s, wl, wp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		cp = format_expand(ft, template);
 | 
							cp = format_expand(ft, template);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -73,7 +73,7 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	if (template == NULL)
 | 
						if (template == NULL)
 | 
				
			||||||
		template = DISPLAY_MESSAGE_TEMPLATE;
 | 
							template = DISPLAY_MESSAGE_TEMPLATE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ft = format_create(item, 0);
 | 
						ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
	format_defaults(ft, c, s, wl, wp);
 | 
						format_defaults(ft, c, s, wl, wp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	msg = format_expand_time(ft, template, time(NULL));
 | 
						msg = format_expand_time(ft, template, time(NULL));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -82,7 +82,7 @@ cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	else
 | 
						else
 | 
				
			||||||
		cwd = NULL;
 | 
							cwd = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ft = format_create(item, 0);
 | 
						ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
	format_defaults(ft, item->state.c, s, wl, wp);
 | 
						format_defaults(ft, item->state.c, s, wl, wp);
 | 
				
			||||||
	shellcmd = format_expand(ft, args->argv[0]);
 | 
						shellcmd = format_expand(ft, args->argv[0]);
 | 
				
			||||||
	format_free(ft);
 | 
						format_free(ft);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,7 +57,7 @@ cmd_list_buffers_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	pb = NULL;
 | 
						pb = NULL;
 | 
				
			||||||
	while ((pb = paste_walk(pb)) != NULL) {
 | 
						while ((pb = paste_walk(pb)) != NULL) {
 | 
				
			||||||
		ft = format_create(item, 0);
 | 
							ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
		format_defaults_paste_buffer(ft, pb);
 | 
							format_defaults_paste_buffer(ft, pb);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		line = format_expand(ft, template);
 | 
							line = format_expand(ft, template);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -72,7 +72,7 @@ cmd_list_clients_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
		if (c->session == NULL || (s != NULL && s != c->session))
 | 
							if (c->session == NULL || (s != NULL && s != c->session))
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ft = format_create(item, 0);
 | 
							ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
		format_add(ft, "line", "%u", idx);
 | 
							format_add(ft, "line", "%u", idx);
 | 
				
			||||||
		format_defaults(ft, c, NULL, NULL, NULL);
 | 
							format_defaults(ft, c, NULL, NULL, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -144,7 +144,7 @@ cmd_list_keys_commands(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
		    "#{command_list_usage}";
 | 
							    "#{command_list_usage}";
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ft = format_create(item, 0);
 | 
						ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
	format_defaults(ft, NULL, NULL, NULL, NULL);
 | 
						format_defaults(ft, NULL, NULL, NULL, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (entryp = cmd_table; *entryp != NULL; entryp++) {
 | 
						for (entryp = cmd_table; *entryp != NULL; entryp++) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -123,7 +123,7 @@ cmd_list_panes_window(struct cmd *self, struct session *s, struct winlink *wl,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	n = 0;
 | 
						n = 0;
 | 
				
			||||||
	TAILQ_FOREACH(wp, &wl->window->panes, entry) {
 | 
						TAILQ_FOREACH(wp, &wl->window->panes, entry) {
 | 
				
			||||||
		ft = format_create(item, 0);
 | 
							ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
		format_add(ft, "line", "%u", n);
 | 
							format_add(ft, "line", "%u", n);
 | 
				
			||||||
		format_defaults(ft, NULL, s, wl, wp);
 | 
							format_defaults(ft, NULL, s, wl, wp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -65,7 +65,7 @@ cmd_list_sessions_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	n = 0;
 | 
						n = 0;
 | 
				
			||||||
	RB_FOREACH(s, sessions, &sessions) {
 | 
						RB_FOREACH(s, sessions, &sessions) {
 | 
				
			||||||
		ft = format_create(item, 0);
 | 
							ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
		format_add(ft, "line", "%u", n);
 | 
							format_add(ft, "line", "%u", n);
 | 
				
			||||||
		format_defaults(ft, NULL, s, NULL, NULL);
 | 
							format_defaults(ft, NULL, s, NULL, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -105,7 +105,7 @@ cmd_list_windows_session(struct cmd *self, struct session *s,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	n = 0;
 | 
						n = 0;
 | 
				
			||||||
	RB_FOREACH(wl, winlinks, &s->windows) {
 | 
						RB_FOREACH(wl, winlinks, &s->windows) {
 | 
				
			||||||
		ft = format_create(item, 0);
 | 
							ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
		format_add(ft, "line", "%u", n);
 | 
							format_add(ft, "line", "%u", n);
 | 
				
			||||||
		format_defaults(ft, NULL, s, wl, NULL);
 | 
							format_defaults(ft, NULL, s, wl, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -139,7 +139,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	/* Get the new session working directory. */
 | 
						/* Get the new session working directory. */
 | 
				
			||||||
	if (args_has(args, 'c')) {
 | 
						if (args_has(args, 'c')) {
 | 
				
			||||||
		ft = format_create(item, 0);
 | 
							ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
		format_defaults(ft, c, NULL, NULL, NULL);
 | 
							format_defaults(ft, c, NULL, NULL, NULL);
 | 
				
			||||||
		to_free = cwd = format_expand(ft, args_get(args, 'c'));
 | 
							to_free = cwd = format_expand(ft, args_get(args, 'c'));
 | 
				
			||||||
		format_free(ft);
 | 
							format_free(ft);
 | 
				
			||||||
@@ -298,7 +298,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
		if ((template = args_get(args, 'F')) == NULL)
 | 
							if ((template = args_get(args, 'F')) == NULL)
 | 
				
			||||||
			template = NEW_SESSION_TEMPLATE;
 | 
								template = NEW_SESSION_TEMPLATE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ft = format_create(item, 0);
 | 
							ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
		format_defaults(ft, c, s, NULL, NULL);
 | 
							format_defaults(ft, c, s, NULL, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		cp = format_expand(ft, template);
 | 
							cp = format_expand(ft, template);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -95,7 +95,7 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	to_free = NULL;
 | 
						to_free = NULL;
 | 
				
			||||||
	if (args_has(args, 'c')) {
 | 
						if (args_has(args, 'c')) {
 | 
				
			||||||
		ft = format_create(item, 0);
 | 
							ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
		format_defaults(ft, c, s, NULL, NULL);
 | 
							format_defaults(ft, c, s, NULL, NULL);
 | 
				
			||||||
		cwd = to_free = format_expand(ft, args_get(args, 'c'));
 | 
							cwd = to_free = format_expand(ft, args_get(args, 'c'));
 | 
				
			||||||
		format_free(ft);
 | 
							format_free(ft);
 | 
				
			||||||
@@ -143,7 +143,7 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
		if ((template = args_get(args, 'F')) == NULL)
 | 
							if ((template = args_get(args, 'F')) == NULL)
 | 
				
			||||||
			template = NEW_WINDOW_TEMPLATE;
 | 
								template = NEW_WINDOW_TEMPLATE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ft = format_create(item, 0);
 | 
							ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
		format_defaults(ft, c, s, wl, NULL);
 | 
							format_defaults(ft, c, s, wl, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		cp = format_expand(ft, template);
 | 
							cp = format_expand(ft, template);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -89,7 +89,7 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Expand the command. */
 | 
						/* Expand the command. */
 | 
				
			||||||
	ft = format_create(item, 0);
 | 
						ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
	format_defaults(ft, c, s, wl, wp);
 | 
						format_defaults(ft, c, s, wl, wp);
 | 
				
			||||||
	cmd = format_expand_time(ft, args->argv[0], time(NULL));
 | 
						cmd = format_expand_time(ft, args->argv[0], time(NULL));
 | 
				
			||||||
	format_free(ft);
 | 
						format_free(ft);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -268,7 +268,7 @@ cmdq_format(struct cmdq_item *item, const char *key, const char *fmt, ...)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	for (loop = item; loop != NULL; loop = item->next) {
 | 
						for (loop = item; loop != NULL; loop = item->next) {
 | 
				
			||||||
		if (loop->formats == NULL)
 | 
							if (loop->formats == NULL)
 | 
				
			||||||
			loop->formats = format_create(NULL, 0);
 | 
								loop->formats = format_create(NULL, FORMAT_NONE, 0);
 | 
				
			||||||
		format_add(loop->formats, key, "%s", value);
 | 
							format_add(loop->formats, key, "%s", value);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -100,7 +100,7 @@ cmd_run_shell_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	else
 | 
						else
 | 
				
			||||||
		cwd = NULL;
 | 
							cwd = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ft = format_create(item, 0);
 | 
						ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
	format_defaults(ft, item->state.c, s, wl, wp);
 | 
						format_defaults(ft, item->state.c, s, wl, wp);
 | 
				
			||||||
	shellcmd = format_expand(ft, args->argv[0]);
 | 
						shellcmd = format_expand(ft, args->argv[0]);
 | 
				
			||||||
	format_free(ft);
 | 
						format_free(ft);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -91,7 +91,7 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	to_free = NULL;
 | 
						to_free = NULL;
 | 
				
			||||||
	if (args_has(args, 'c')) {
 | 
						if (args_has(args, 'c')) {
 | 
				
			||||||
		ft = format_create(item, 0);
 | 
							ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
		format_defaults(ft, item->state.c, s, NULL, NULL);
 | 
							format_defaults(ft, item->state.c, s, NULL, NULL);
 | 
				
			||||||
		to_free = cwd = format_expand(ft, args_get(args, 'c'));
 | 
							to_free = cwd = format_expand(ft, args_get(args, 'c'));
 | 
				
			||||||
		format_free(ft);
 | 
							format_free(ft);
 | 
				
			||||||
@@ -168,7 +168,7 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
		if ((template = args_get(args, 'F')) == NULL)
 | 
							if ((template = args_get(args, 'F')) == NULL)
 | 
				
			||||||
			template = SPLIT_WINDOW_TEMPLATE;
 | 
								template = SPLIT_WINDOW_TEMPLATE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ft = format_create(item, 0);
 | 
							ft = format_create(item, FORMAT_NONE, 0);
 | 
				
			||||||
		format_defaults(ft, item->state.c, s, wl, new_wp);
 | 
							format_defaults(ft, item->state.c, s, wl, new_wp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		cp = format_expand(ft, template);
 | 
							cp = format_expand(ft, template);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -88,7 +88,7 @@ control_notify_window_layout_changed(struct window *w)
 | 
				
			|||||||
		if (w->layout_root == NULL)
 | 
							if (w->layout_root == NULL)
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ft = format_create(NULL, 0);
 | 
							ft = format_create(NULL, FORMAT_NONE, 0);
 | 
				
			||||||
		wl = winlink_find_by_window(&s->windows, w);
 | 
							wl = winlink_find_by_window(&s->windows, w);
 | 
				
			||||||
		if (wl != NULL) {
 | 
							if (wl != NULL) {
 | 
				
			||||||
			format_defaults(ft, c, NULL, wl, NULL);
 | 
								format_defaults(ft, c, NULL, wl, NULL);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								format.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								format.c
									
									
									
									
									
								
							@@ -81,6 +81,7 @@ static void	 format_defaults_winlink(struct format_tree *, struct session *,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* Entry in format job tree. */
 | 
					/* Entry in format job tree. */
 | 
				
			||||||
struct format_job {
 | 
					struct format_job {
 | 
				
			||||||
 | 
						u_int			 tag;
 | 
				
			||||||
	const char		*cmd;
 | 
						const char		*cmd;
 | 
				
			||||||
	const char		*expanded;
 | 
						const char		*expanded;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -103,6 +104,10 @@ RB_GENERATE_STATIC(format_job_tree, format_job, entry, format_job_cmp);
 | 
				
			|||||||
static int
 | 
					static int
 | 
				
			||||||
format_job_cmp(struct format_job *fj1, struct format_job *fj2)
 | 
					format_job_cmp(struct format_job *fj1, struct format_job *fj2)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						if (fj1->tag < fj2->tag)
 | 
				
			||||||
 | 
							return (-1);
 | 
				
			||||||
 | 
						if (fj1->tag > fj2->tag)
 | 
				
			||||||
 | 
							return (1);
 | 
				
			||||||
	return (strcmp(fj1->cmd, fj2->cmd));
 | 
						return (strcmp(fj1->cmd, fj2->cmd));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -127,6 +132,7 @@ struct format_tree {
 | 
				
			|||||||
	struct session		*s;
 | 
						struct session		*s;
 | 
				
			||||||
	struct window_pane	*wp;
 | 
						struct window_pane	*wp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						u_int			 tag;
 | 
				
			||||||
	int			 flags;
 | 
						int			 flags;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	RB_HEAD(format_entry_tree, format_entry) tree;
 | 
						RB_HEAD(format_entry_tree, format_entry) tree;
 | 
				
			||||||
@@ -242,9 +248,11 @@ format_job_get(struct format_tree *ft, const char *cmd)
 | 
				
			|||||||
	char			*expanded;
 | 
						char			*expanded;
 | 
				
			||||||
	int			 force;
 | 
						int			 force;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						fj0.tag = ft->tag;
 | 
				
			||||||
	fj0.cmd = cmd;
 | 
						fj0.cmd = cmd;
 | 
				
			||||||
	if ((fj = RB_FIND(format_job_tree, &format_jobs, &fj0)) == NULL) {
 | 
						if ((fj = RB_FIND(format_job_tree, &format_jobs, &fj0)) == NULL) {
 | 
				
			||||||
		fj = xcalloc(1, sizeof *fj);
 | 
							fj = xcalloc(1, sizeof *fj);
 | 
				
			||||||
 | 
							fj->tag = ft->tag;
 | 
				
			||||||
		fj->cmd = xstrdup(cmd);
 | 
							fj->cmd = xstrdup(cmd);
 | 
				
			||||||
		fj->expanded = NULL;
 | 
							fj->expanded = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -516,7 +524,7 @@ format_merge(struct format_tree *ft, struct format_tree *from)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* Create a new tree. */
 | 
					/* Create a new tree. */
 | 
				
			||||||
struct format_tree *
 | 
					struct format_tree *
 | 
				
			||||||
format_create(struct cmdq_item *item, int flags)
 | 
					format_create(struct cmdq_item *item, int tag, int flags)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct format_tree	*ft;
 | 
						struct format_tree	*ft;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -527,6 +535,8 @@ format_create(struct cmdq_item *item, int flags)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	ft = xcalloc(1, sizeof *ft);
 | 
						ft = xcalloc(1, sizeof *ft);
 | 
				
			||||||
	RB_INIT(&ft->tree);
 | 
						RB_INIT(&ft->tree);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ft->tag = tag;
 | 
				
			||||||
	ft->flags = flags;
 | 
						ft->flags = flags;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	format_add(ft, "version", "%s", VERSION);
 | 
						format_add(ft, "version", "%s", VERSION);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								names.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								names.c
									
									
									
									
									
								
							@@ -124,7 +124,7 @@ format_window_name(struct window *w)
 | 
				
			|||||||
	const char		*fmt;
 | 
						const char		*fmt;
 | 
				
			||||||
	char			*name;
 | 
						char			*name;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ft = format_create(NULL, 0);
 | 
						ft = format_create(NULL, FORMAT_WINDOW|w->id, 0);
 | 
				
			||||||
	format_defaults_window(ft, w);
 | 
						format_defaults_window(ft, w);
 | 
				
			||||||
	format_defaults_pane(ft, w->active);
 | 
						format_defaults_pane(ft, w->active);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -280,7 +280,7 @@ screen_redraw_make_pane_status(struct client *c, struct window *w,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	fmt = options_get_string(w->options, "pane-border-format");
 | 
						fmt = options_get_string(w->options, "pane-border-format");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ft = format_create(NULL, 0);
 | 
						ft = format_create(NULL, FORMAT_PANE|wp->id, 0);
 | 
				
			||||||
	format_defaults(ft, c, NULL, NULL, wp);
 | 
						format_defaults(ft, c, NULL, NULL, wp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	memcpy(&old, &wp->status_screen, sizeof old);
 | 
						memcpy(&old, &wp->status_screen, sizeof old);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1230,7 +1230,7 @@ server_client_set_title(struct client *c)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	template = options_get_string(s->options, "set-titles-string");
 | 
						template = options_get_string(s->options, "set-titles-string");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ft = format_create(NULL, 0);
 | 
						ft = format_create(NULL, FORMAT_NONE, 0);
 | 
				
			||||||
	format_defaults(ft, c, NULL, NULL, NULL);
 | 
						format_defaults(ft, c, NULL, NULL, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	title = format_expand_time(ft, template, time(NULL));
 | 
						title = format_expand_time(ft, template, time(NULL));
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										15
									
								
								status.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								status.c
									
									
									
									
									
								
							@@ -500,14 +500,19 @@ status_replace(struct client *c, struct winlink *wl, const char *fmt, time_t t)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	struct format_tree	*ft;
 | 
						struct format_tree	*ft;
 | 
				
			||||||
	char			*expanded;
 | 
						char			*expanded;
 | 
				
			||||||
 | 
						u_int			 tag;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (fmt == NULL)
 | 
						if (fmt == NULL)
 | 
				
			||||||
		return (xstrdup(""));
 | 
							return (xstrdup(""));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (c->flags & CLIENT_STATUSFORCE)
 | 
						if (wl != NULL)
 | 
				
			||||||
		ft = format_create(NULL, FORMAT_STATUS|FORMAT_FORCE);
 | 
							tag = FORMAT_WINDOW|wl->window->id;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		ft = format_create(NULL, FORMAT_STATUS);
 | 
							tag = FORMAT_NONE;
 | 
				
			||||||
 | 
						if (c->flags & CLIENT_STATUSFORCE)
 | 
				
			||||||
 | 
							ft = format_create(NULL, tag, FORMAT_STATUS|FORMAT_FORCE);
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							ft = format_create(NULL, tag, FORMAT_STATUS);
 | 
				
			||||||
	format_defaults(ft, c, NULL, wl, NULL);
 | 
						format_defaults(ft, c, NULL, wl, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	expanded = format_expand_time(ft, fmt, t);
 | 
						expanded = format_expand_time(ft, fmt, t);
 | 
				
			||||||
@@ -665,7 +670,7 @@ status_prompt_set(struct client *c, const char *msg, const char *input,
 | 
				
			|||||||
	time_t			 t;
 | 
						time_t			 t;
 | 
				
			||||||
	char			*tmp;
 | 
						char			*tmp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ft = format_create(NULL, 0);
 | 
						ft = format_create(NULL, FORMAT_NONE, 0);
 | 
				
			||||||
	format_defaults(ft, c, NULL, NULL, NULL);
 | 
						format_defaults(ft, c, NULL, NULL, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	t = time(NULL);
 | 
						t = time(NULL);
 | 
				
			||||||
@@ -726,7 +731,7 @@ status_prompt_update(struct client *c, const char *msg, const char *input)
 | 
				
			|||||||
	time_t			 t;
 | 
						time_t			 t;
 | 
				
			||||||
	char			*tmp;
 | 
						char			*tmp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ft = format_create(NULL, 0);
 | 
						ft = format_create(NULL, FORMAT_NONE, 0);
 | 
				
			||||||
	format_defaults(ft, c, NULL, NULL, NULL);
 | 
						format_defaults(ft, c, NULL, NULL, NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	t = time(NULL);
 | 
						t = time(NULL);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										5
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								tmux.h
									
									
									
									
									
								
							@@ -1505,8 +1505,11 @@ char		*paste_make_sample(struct paste_buffer *);
 | 
				
			|||||||
#define FORMAT_STATUS 0x1
 | 
					#define FORMAT_STATUS 0x1
 | 
				
			||||||
#define FORMAT_FORCE 0x2
 | 
					#define FORMAT_FORCE 0x2
 | 
				
			||||||
#define FORMAT_NOJOBS 0x4
 | 
					#define FORMAT_NOJOBS 0x4
 | 
				
			||||||
 | 
					#define FORMAT_NONE 0
 | 
				
			||||||
 | 
					#define FORMAT_PANE 0x80000000U
 | 
				
			||||||
 | 
					#define FORMAT_WINDOW 0x40000000U
 | 
				
			||||||
struct format_tree;
 | 
					struct format_tree;
 | 
				
			||||||
struct format_tree *format_create(struct cmdq_item *, int);
 | 
					struct format_tree *format_create(struct cmdq_item *, int, int);
 | 
				
			||||||
void		 format_free(struct format_tree *);
 | 
					void		 format_free(struct format_tree *);
 | 
				
			||||||
void printflike(3, 4) format_add(struct format_tree *, const char *,
 | 
					void printflike(3, 4) format_add(struct format_tree *, const char *,
 | 
				
			||||||
		     const char *, ...);
 | 
							     const char *, ...);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -202,7 +202,7 @@ window_choose_data_create(int type, struct client *c, struct session *s)
 | 
				
			|||||||
	wcd = xmalloc(sizeof *wcd);
 | 
						wcd = xmalloc(sizeof *wcd);
 | 
				
			||||||
	wcd->type = type;
 | 
						wcd->type = type;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wcd->ft = format_create(NULL, 0);
 | 
						wcd->ft = format_create(NULL, FORMAT_NONE, 0);
 | 
				
			||||||
	wcd->ft_template = NULL;
 | 
						wcd->ft_template = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wcd->command = NULL;
 | 
						wcd->command = NULL;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1611,7 +1611,7 @@ window_copy_copy_pipe(struct window_pane *wp, struct session *sess,
 | 
				
			|||||||
	if (buf == NULL)
 | 
						if (buf == NULL)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ft = format_create(NULL, 0);
 | 
						ft = format_create(NULL, FORMAT_NONE, 0);
 | 
				
			||||||
	format_defaults(ft, NULL, sess, NULL, wp);
 | 
						format_defaults(ft, NULL, sess, NULL, wp);
 | 
				
			||||||
	expanded = format_expand(ft, arg);
 | 
						expanded = format_expand(ft, arg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user