mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		@@ -93,7 +93,7 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (cflag != NULL) {
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s,
 | 
			
		||||
		    NULL, NULL);
 | 
			
		||||
		cwd = format_expand(ft, cflag);
 | 
			
		||||
 
 | 
			
		||||
@@ -101,7 +101,7 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
		if ((template = args_get(args, 'F')) == NULL)
 | 
			
		||||
			template = BREAK_PANE_TEMPLATE;
 | 
			
		||||
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		format_defaults(ft, cmd_find_client(cmdq, NULL, 1), dst_s, wl,
 | 
			
		||||
		    wp);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -88,7 +88,7 @@ cmd_display_message_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
	if (template == NULL)
 | 
			
		||||
		template = DISPLAY_MESSAGE_TEMPLATE;
 | 
			
		||||
 | 
			
		||||
	ft = format_create();
 | 
			
		||||
	ft = format_create(0);
 | 
			
		||||
	format_defaults(ft, c, s, wl, wp);
 | 
			
		||||
 | 
			
		||||
	msg = format_expand_time(ft, template, time(NULL));
 | 
			
		||||
 
 | 
			
		||||
@@ -86,7 +86,7 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
			cwd = NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ft = format_create();
 | 
			
		||||
	ft = format_create(0);
 | 
			
		||||
	format_defaults(ft, NULL, s, wl, wp);
 | 
			
		||||
	shellcmd = format_expand(ft, args->argv[0]);
 | 
			
		||||
	format_free(ft);
 | 
			
		||||
 
 | 
			
		||||
@@ -54,7 +54,7 @@ cmd_list_buffers_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
 | 
			
		||||
	pb = NULL;
 | 
			
		||||
	while ((pb = paste_walk(pb)) != NULL) {
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		format_defaults_paste_buffer(ft, pb);
 | 
			
		||||
 | 
			
		||||
		line = format_expand(ft, template);
 | 
			
		||||
 
 | 
			
		||||
@@ -69,7 +69,7 @@ cmd_list_clients_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
		if (c->session == NULL || (s != NULL && s != c->session))
 | 
			
		||||
			continue;
 | 
			
		||||
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		format_add(ft, "line", "%u", idx);
 | 
			
		||||
		format_defaults(ft, c, NULL, NULL, NULL);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -125,7 +125,7 @@ cmd_list_panes_window(struct cmd *self, struct session *s, struct winlink *wl,
 | 
			
		||||
 | 
			
		||||
	n = 0;
 | 
			
		||||
	TAILQ_FOREACH(wp, &wl->window->panes, entry) {
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		format_add(ft, "line", "%u", n);
 | 
			
		||||
		format_defaults(ft, NULL, s, wl, wp);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -61,7 +61,7 @@ cmd_list_sessions_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
 | 
			
		||||
	n = 0;
 | 
			
		||||
	RB_FOREACH(s, sessions, &sessions) {
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		format_add(ft, "line", "%u", n);
 | 
			
		||||
		format_defaults(ft, NULL, s, NULL, NULL);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -105,7 +105,7 @@ cmd_list_windows_session(
 | 
			
		||||
 | 
			
		||||
	n = 0;
 | 
			
		||||
	RB_FOREACH(wl, winlinks, &s->windows) {
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		format_add(ft, "line", "%u", n);
 | 
			
		||||
		format_defaults(ft, NULL, s, wl, NULL);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -119,7 +119,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
	/* Get the new session working directory. */
 | 
			
		||||
	to_free = NULL;
 | 
			
		||||
	if (args_has(args, 'c')) {
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		format_defaults(ft, cmd_find_client(cmdq, NULL, 1), NULL, NULL,
 | 
			
		||||
		    NULL);
 | 
			
		||||
		to_free = cwd = format_expand(ft, args_get(args, 'c'));
 | 
			
		||||
@@ -283,7 +283,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
		if ((template = args_get(args, 'F')) == NULL)
 | 
			
		||||
			template = NEW_SESSION_TEMPLATE;
 | 
			
		||||
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, NULL,
 | 
			
		||||
		    NULL);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -94,7 +94,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
 | 
			
		||||
	to_free = NULL;
 | 
			
		||||
	if (args_has(args, 'c')) {
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, NULL,
 | 
			
		||||
		    NULL);
 | 
			
		||||
		cwd = to_free = format_expand(ft, args_get(args, 'c'));
 | 
			
		||||
@@ -143,7 +143,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
		if ((template = args_get(args, 'F')) == NULL)
 | 
			
		||||
			template = NEW_WINDOW_TEMPLATE;
 | 
			
		||||
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, wl,
 | 
			
		||||
		    NULL);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -88,7 +88,7 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Expand the command. */
 | 
			
		||||
	ft = format_create();
 | 
			
		||||
	ft = format_create(0);
 | 
			
		||||
	format_defaults(ft, c, s, wl, wp);
 | 
			
		||||
	cmd = format_expand_time(ft, args->argv[0], time(NULL));
 | 
			
		||||
	format_free(ft);
 | 
			
		||||
 
 | 
			
		||||
@@ -100,7 +100,7 @@ cmd_run_shell_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
			cwd = NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ft = format_create();
 | 
			
		||||
	ft = format_create(0);
 | 
			
		||||
	format_defaults(ft, NULL, s, wl, wp);
 | 
			
		||||
	shellcmd = format_expand(ft, args->argv[0]);
 | 
			
		||||
	format_free(ft);
 | 
			
		||||
 
 | 
			
		||||
@@ -87,7 +87,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
 | 
			
		||||
	to_free = NULL;
 | 
			
		||||
	if (args_has(args, 'c')) {
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, NULL,
 | 
			
		||||
		    NULL);
 | 
			
		||||
		to_free = cwd = format_expand(ft, args_get(args, 'c'));
 | 
			
		||||
@@ -164,7 +164,7 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
			
		||||
		if ((template = args_get(args, 'F')) == NULL)
 | 
			
		||||
			template = SPLIT_WINDOW_TEMPLATE;
 | 
			
		||||
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, wl,
 | 
			
		||||
		    new_wp);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -88,7 +88,7 @@ control_notify_window_layout_changed(struct window *w)
 | 
			
		||||
		if (w->layout_root == NULL)
 | 
			
		||||
			continue;
 | 
			
		||||
 | 
			
		||||
		ft = format_create();
 | 
			
		||||
		ft = format_create(0);
 | 
			
		||||
		wl = winlink_find_by_window(&s->windows, w);
 | 
			
		||||
		if (wl != NULL) {
 | 
			
		||||
			format_defaults(ft, c, NULL, wl, NULL);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										9
									
								
								format.c
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								format.c
									
									
									
									
									
								
							@@ -482,14 +482,7 @@ format_cb_pane_tabs(struct format_tree *ft, struct format_entry *fe)
 | 
			
		||||
 | 
			
		||||
/* Create a new tree. */
 | 
			
		||||
struct format_tree *
 | 
			
		||||
format_create(void)
 | 
			
		||||
{
 | 
			
		||||
	return (format_create_flags(0));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Create a new tree for the status line. */
 | 
			
		||||
struct format_tree *
 | 
			
		||||
format_create_flags(int flags)
 | 
			
		||||
format_create(int flags)
 | 
			
		||||
{
 | 
			
		||||
	struct format_tree	*ft;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								names.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								names.c
									
									
									
									
									
								
							@@ -118,7 +118,7 @@ format_window_name(struct window *w)
 | 
			
		||||
	struct format_tree	*ft;
 | 
			
		||||
	char			*fmt, *name;
 | 
			
		||||
 | 
			
		||||
	ft = format_create();
 | 
			
		||||
	ft = format_create(0);
 | 
			
		||||
	format_defaults_window(ft, w);
 | 
			
		||||
	format_defaults_pane(ft, w->active);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -47,7 +47,7 @@ options_cmp(struct options_entry *o1, struct options_entry *o2)
 | 
			
		||||
struct options *
 | 
			
		||||
options_create(struct options *parent)
 | 
			
		||||
{
 | 
			
		||||
	struct options *oo;
 | 
			
		||||
	struct options	*oo;
 | 
			
		||||
 | 
			
		||||
	oo = xcalloc(1, sizeof *oo);
 | 
			
		||||
	RB_INIT(&oo->tree);
 | 
			
		||||
 
 | 
			
		||||
@@ -941,7 +941,7 @@ server_client_set_title(struct client *c)
 | 
			
		||||
 | 
			
		||||
	template = options_get_string(s->options, "set-titles-string");
 | 
			
		||||
 | 
			
		||||
	ft = format_create();
 | 
			
		||||
	ft = format_create(0);
 | 
			
		||||
	format_defaults(ft, c, NULL, NULL, NULL);
 | 
			
		||||
 | 
			
		||||
	title = format_expand_time(ft, template, time(NULL));
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								status.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								status.c
									
									
									
									
									
								
							@@ -500,9 +500,9 @@ status_replace(struct client *c, struct winlink *wl, const char *fmt, time_t t)
 | 
			
		||||
		return (xstrdup(""));
 | 
			
		||||
 | 
			
		||||
	if (c->flags & CLIENT_STATUSFORCE)
 | 
			
		||||
		ft = format_create_flags(FORMAT_STATUS|FORMAT_FORCE);
 | 
			
		||||
		ft = format_create(FORMAT_STATUS|FORMAT_FORCE);
 | 
			
		||||
	else
 | 
			
		||||
		ft = format_create_flags(FORMAT_STATUS);
 | 
			
		||||
		ft = format_create(FORMAT_STATUS);
 | 
			
		||||
	format_defaults(ft, c, NULL, wl, NULL);
 | 
			
		||||
 | 
			
		||||
	expanded = format_expand_time(ft, fmt, t);
 | 
			
		||||
@@ -661,7 +661,7 @@ status_prompt_set(struct client *c, const char *msg, const char *input,
 | 
			
		||||
	int			 keys;
 | 
			
		||||
	time_t			 t;
 | 
			
		||||
 | 
			
		||||
	ft = format_create();
 | 
			
		||||
	ft = format_create(0);
 | 
			
		||||
	format_defaults(ft, c, NULL, NULL, NULL);
 | 
			
		||||
	t = time(NULL);
 | 
			
		||||
 | 
			
		||||
@@ -722,7 +722,7 @@ status_prompt_update(struct client *c, const char *msg, const char *input)
 | 
			
		||||
	struct format_tree	*ft;
 | 
			
		||||
	time_t			 t;
 | 
			
		||||
 | 
			
		||||
	ft = format_create();
 | 
			
		||||
	ft = format_create(0);
 | 
			
		||||
	format_defaults(ft, c, NULL, NULL, NULL);
 | 
			
		||||
	t = time(NULL);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								tmux.h
									
									
									
									
									
								
							@@ -695,10 +695,12 @@ struct grid {
 | 
			
		||||
 | 
			
		||||
/* Hook data structures. */
 | 
			
		||||
struct hook {
 | 
			
		||||
	const char      *name;
 | 
			
		||||
	struct cmd_q    *cmdq;
 | 
			
		||||
	struct cmd_list *cmdlist;
 | 
			
		||||
	RB_ENTRY(hook)   entry;
 | 
			
		||||
	const char	*name;
 | 
			
		||||
 | 
			
		||||
	struct cmd_q	*cmdq;
 | 
			
		||||
	struct cmd_list	*cmdlist;
 | 
			
		||||
 | 
			
		||||
	RB_ENTRY(hook)	 entry;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Option data structures. */
 | 
			
		||||
@@ -1492,8 +1494,7 @@ char		*paste_make_sample(struct paste_buffer *);
 | 
			
		||||
#define FORMAT_STATUS 0x1
 | 
			
		||||
#define FORMAT_FORCE 0x2
 | 
			
		||||
struct format_tree;
 | 
			
		||||
struct format_tree *format_create(void);
 | 
			
		||||
struct format_tree *format_create_flags(int);
 | 
			
		||||
struct format_tree *format_create(int);
 | 
			
		||||
void		 format_free(struct format_tree *);
 | 
			
		||||
void printflike(3, 4) format_add(struct format_tree *, const char *,
 | 
			
		||||
		     const char *, ...);
 | 
			
		||||
 
 | 
			
		||||
@@ -186,7 +186,7 @@ window_choose_data_create(int type, struct client *c, struct session *s)
 | 
			
		||||
	wcd = xmalloc(sizeof *wcd);
 | 
			
		||||
	wcd->type = type;
 | 
			
		||||
 | 
			
		||||
	wcd->ft = format_create();
 | 
			
		||||
	wcd->ft = format_create(0);
 | 
			
		||||
	wcd->ft_template = NULL;
 | 
			
		||||
 | 
			
		||||
	wcd->command = NULL;
 | 
			
		||||
 
 | 
			
		||||
@@ -1480,7 +1480,7 @@ window_copy_copy_pipe(struct window_pane *wp, struct session *sess,
 | 
			
		||||
	if (buf == NULL)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	ft = format_create();
 | 
			
		||||
	ft = format_create(0);
 | 
			
		||||
	format_defaults(ft, NULL, sess, NULL, wp);
 | 
			
		||||
	expanded = format_expand(ft, arg);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user