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:
		@@ -237,7 +237,7 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (nlines != 0)
 | 
						if (nlines != 0)
 | 
				
			||||||
		h = nlines + 2;
 | 
							h = popup_height(nlines, lines) + 2;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		h = c->tty.sy / 2;
 | 
							h = c->tty.sy / 2;
 | 
				
			||||||
	if (args_has(args, 'h')) {
 | 
						if (args_has(args, 'h')) {
 | 
				
			||||||
@@ -262,6 +262,10 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (w > c->tty.sx - 1)
 | 
				
			||||||
 | 
							w = c->tty.sx - 1;
 | 
				
			||||||
 | 
						if (h > c->tty.sy - 1)
 | 
				
			||||||
 | 
							h = c->tty.sy - 1;
 | 
				
			||||||
	cmd_display_menu_get_position(c, item, args, &px, &py, w, h);
 | 
						cmd_display_menu_get_position(c, item, args, &px, &py, w, h);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	value = args_get(args, 'd');
 | 
						value = args_get(args, 'd');
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										6
									
								
								format.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								format.c
									
									
									
									
									
								
							@@ -2436,6 +2436,8 @@ void
 | 
				
			|||||||
format_defaults(struct format_tree *ft, struct client *c, struct session *s,
 | 
					format_defaults(struct format_tree *ft, struct client *c, struct session *s,
 | 
				
			||||||
    struct winlink *wl, struct window_pane *wp)
 | 
					    struct winlink *wl, struct window_pane *wp)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						struct paste_buffer	*pb;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (c != NULL && c->name != NULL)
 | 
						if (c != NULL && c->name != NULL)
 | 
				
			||||||
		log_debug("%s: c=%s", __func__, c->name);
 | 
							log_debug("%s: c=%s", __func__, c->name);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
@@ -2475,6 +2477,10 @@ format_defaults(struct format_tree *ft, struct client *c, struct session *s,
 | 
				
			|||||||
		format_defaults_winlink(ft, wl);
 | 
							format_defaults_winlink(ft, wl);
 | 
				
			||||||
	if (wp != NULL)
 | 
						if (wp != NULL)
 | 
				
			||||||
		format_defaults_pane(ft, wp);
 | 
							format_defaults_pane(ft, wp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pb = paste_get_top (NULL);
 | 
				
			||||||
 | 
						if (pb != NULL)
 | 
				
			||||||
 | 
							format_defaults_paste_buffer(ft, pb);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Set default format keys for a session. */
 | 
					/* Set default format keys for a session. */
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										20
									
								
								popup.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								popup.c
									
									
									
									
									
								
							@@ -349,6 +349,22 @@ popup_job_complete_cb(struct job *job)
 | 
				
			|||||||
		server_client_clear_overlay(pd->c);
 | 
							server_client_clear_overlay(pd->c);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					u_int
 | 
				
			||||||
 | 
					popup_height(u_int nlines, const char **lines)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						char	*copy, *next, *loop;
 | 
				
			||||||
 | 
						u_int	 i, height = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						for (i = 0; i < nlines; i++) {
 | 
				
			||||||
 | 
							copy = next = xstrdup(lines[i]);
 | 
				
			||||||
 | 
							while ((loop = strsep(&next, "\n")) != NULL)
 | 
				
			||||||
 | 
								height++;
 | 
				
			||||||
 | 
							free(copy);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return (height);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
u_int
 | 
					u_int
 | 
				
			||||||
popup_width(struct cmdq_item *item, u_int nlines, const char **lines,
 | 
					popup_width(struct cmdq_item *item, u_int nlines, const char **lines,
 | 
				
			||||||
    struct client *c, struct cmd_find_state *fs)
 | 
					    struct client *c, struct cmd_find_state *fs)
 | 
				
			||||||
@@ -372,8 +388,8 @@ popup_width(struct cmdq_item *item, u_int nlines, const char **lines,
 | 
				
			|||||||
				width = tmpwidth;
 | 
									width = tmpwidth;
 | 
				
			||||||
			free(tmp);
 | 
								free(tmp);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							free(copy);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	free(copy);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	format_free(ft);
 | 
						format_free(ft);
 | 
				
			||||||
	return (width);
 | 
						return (width);
 | 
				
			||||||
@@ -394,8 +410,6 @@ popup_display(int flags, struct cmdq_item *item, u_int px, u_int py, u_int sx,
 | 
				
			|||||||
		return (-1);
 | 
							return (-1);
 | 
				
			||||||
	if (c->tty.sx < sx || c->tty.sy < sy)
 | 
						if (c->tty.sx < sx || c->tty.sy < sy)
 | 
				
			||||||
		return (-1);
 | 
							return (-1);
 | 
				
			||||||
	if (nlines > sy - 2)
 | 
					 | 
				
			||||||
		nlines = sy - 2;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pd = xcalloc(1, sizeof *pd);
 | 
						pd = xcalloc(1, sizeof *pd);
 | 
				
			||||||
	pd->item = item;
 | 
						pd->item = item;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								tmux.1
									
									
									
									
									
								
							@@ -5025,7 +5025,7 @@ It may be empty to discard any key presses.
 | 
				
			|||||||
If
 | 
					If
 | 
				
			||||||
.Fl K
 | 
					.Fl K
 | 
				
			||||||
is given together with
 | 
					is given together with
 | 
				
			||||||
.Fl R,
 | 
					.Fl R ,
 | 
				
			||||||
key presses are instead passed to the
 | 
					key presses are instead passed to the
 | 
				
			||||||
.Fl R
 | 
					.Fl R
 | 
				
			||||||
shell command.
 | 
					shell command.
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								tmux.h
									
									
									
									
									
								
							@@ -2767,6 +2767,7 @@ int		 menu_display(struct menu *, int, struct cmdq_item *, u_int,
 | 
				
			|||||||
#define POPUP_CLOSEEXIT 0x2
 | 
					#define POPUP_CLOSEEXIT 0x2
 | 
				
			||||||
u_int		 popup_width(struct cmdq_item *, u_int, const char **,
 | 
					u_int		 popup_width(struct cmdq_item *, u_int, const char **,
 | 
				
			||||||
		    struct client *, struct cmd_find_state *);
 | 
							    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,
 | 
					int		 popup_display(int, struct cmdq_item *, u_int, u_int, u_int,
 | 
				
			||||||
		    u_int, u_int, const char **, const char *, const char *,
 | 
							    u_int, u_int, const char **, const char *, const char *,
 | 
				
			||||||
		    const char *, struct client *, struct cmd_find_state *);
 | 
							    const char *, struct client *, struct cmd_find_state *);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user