mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Need to redraw borders now when some things change. Also change default so that
the active border colour is different in a mode or with synchronize-panes on.
This commit is contained in:
		@@ -54,6 +54,7 @@ cmd_rename_window_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	window_set_name(wl->window, newname);
 | 
						window_set_name(wl->window, newname);
 | 
				
			||||||
	options_set_number(wl->window->options, "automatic-rename", 0);
 | 
						options_set_number(wl->window->options, "automatic-rename", 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						server_redraw_window_borders(wl->window);
 | 
				
			||||||
	server_status_window(wl->window);
 | 
						server_status_window(wl->window);
 | 
				
			||||||
	free(newname);
 | 
						free(newname);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -91,7 +91,6 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
		else
 | 
							else
 | 
				
			||||||
			window_zoom(wp);
 | 
								window_zoom(wp);
 | 
				
			||||||
		server_redraw_window(w);
 | 
							server_redraw_window(w);
 | 
				
			||||||
		server_status_window(w);
 | 
					 | 
				
			||||||
		return (CMD_RETURN_NORMAL);
 | 
							return (CMD_RETURN_NORMAL);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	server_unzoom_window(w);
 | 
						server_unzoom_window(w);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -90,6 +90,7 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wp->flags |= PANE_REDRAW;
 | 
						wp->flags |= PANE_REDRAW;
 | 
				
			||||||
 | 
						server_redraw_window_borders(wp->window);
 | 
				
			||||||
	server_status_window(wp->window);
 | 
						server_status_window(wp->window);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	environ_free(sc.environ);
 | 
						environ_free(sc.environ);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -193,8 +193,10 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if (args_has(args, 'T')) {
 | 
						if (args_has(args, 'T')) {
 | 
				
			||||||
		title = format_single_from_target(item, args_get(args, 'T'));
 | 
							title = format_single_from_target(item, args_get(args, 'T'));
 | 
				
			||||||
		if (screen_set_title(&wp->base, title))
 | 
							if (screen_set_title(&wp->base, title)) {
 | 
				
			||||||
 | 
								server_redraw_window_borders(wp->window);
 | 
				
			||||||
			server_status_window(wp->window);
 | 
								server_status_window(wp->window);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		free(title);
 | 
							free(title);
 | 
				
			||||||
		return (CMD_RETURN_NORMAL);
 | 
							return (CMD_RETURN_NORMAL);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										19
									
								
								input.c
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								input.c
									
									
									
									
									
								
							@@ -1859,8 +1859,10 @@ input_csi_dispatch_winops(struct input_ctx *ictx)
 | 
				
			|||||||
			case 0:
 | 
								case 0:
 | 
				
			||||||
			case 2:
 | 
								case 2:
 | 
				
			||||||
				screen_pop_title(sctx->s);
 | 
									screen_pop_title(sctx->s);
 | 
				
			||||||
				if (wp != NULL)
 | 
									if (wp != NULL) {
 | 
				
			||||||
 | 
										server_redraw_window_borders(wp->window);
 | 
				
			||||||
					server_status_window(wp->window);
 | 
										server_status_window(wp->window);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
@@ -2251,8 +2253,10 @@ input_exit_osc(struct input_ctx *ictx)
 | 
				
			|||||||
	switch (option) {
 | 
						switch (option) {
 | 
				
			||||||
	case 0:
 | 
						case 0:
 | 
				
			||||||
	case 2:
 | 
						case 2:
 | 
				
			||||||
		if (screen_set_title(sctx->s, p) && wp != NULL)
 | 
							if (screen_set_title(sctx->s, p) && wp != NULL) {
 | 
				
			||||||
			server_status_window(ictx->wp->window);
 | 
								server_redraw_window_borders(wp->window);
 | 
				
			||||||
 | 
								server_status_window(wp->window);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case 4:
 | 
						case 4:
 | 
				
			||||||
		input_osc_4(ictx, p);
 | 
							input_osc_4(ictx, p);
 | 
				
			||||||
@@ -2260,8 +2264,10 @@ input_exit_osc(struct input_ctx *ictx)
 | 
				
			|||||||
	case 7:
 | 
						case 7:
 | 
				
			||||||
		if (utf8_isvalid(p)) {
 | 
							if (utf8_isvalid(p)) {
 | 
				
			||||||
			screen_set_path(sctx->s, p);
 | 
								screen_set_path(sctx->s, p);
 | 
				
			||||||
			if (wp != NULL)
 | 
								if (wp != NULL) {
 | 
				
			||||||
 | 
									server_redraw_window_borders(wp->window);
 | 
				
			||||||
				server_status_window(wp->window);
 | 
									server_status_window(wp->window);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case 10:
 | 
						case 10:
 | 
				
			||||||
@@ -2312,8 +2318,10 @@ input_exit_apc(struct input_ctx *ictx)
 | 
				
			|||||||
		return;
 | 
							return;
 | 
				
			||||||
	log_debug("%s: \"%s\"", __func__, ictx->input_buf);
 | 
						log_debug("%s: \"%s\"", __func__, ictx->input_buf);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (screen_set_title(sctx->s, ictx->input_buf) && wp != NULL)
 | 
						if (screen_set_title(sctx->s, ictx->input_buf) && wp != NULL) {
 | 
				
			||||||
 | 
							server_redraw_window_borders(wp->window);
 | 
				
			||||||
		server_status_window(wp->window);
 | 
							server_status_window(wp->window);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Rename string started. */
 | 
					/* Rename string started. */
 | 
				
			||||||
@@ -2353,6 +2361,7 @@ input_exit_rename(struct input_ctx *ictx)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	window_set_name(wp->window, ictx->input_buf);
 | 
						window_set_name(wp->window, ictx->input_buf);
 | 
				
			||||||
	options_set_number(wp->window->options, "automatic-rename", 0);
 | 
						options_set_number(wp->window->options, "automatic-rename", 0);
 | 
				
			||||||
 | 
						server_redraw_window_borders(wp->window);
 | 
				
			||||||
	server_status_window(wp->window);
 | 
						server_status_window(wp->window);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								names.c
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								names.c
									
									
									
									
									
								
							@@ -96,6 +96,7 @@ check_window_name(struct window *w)
 | 
				
			|||||||
	if (strcmp(name, w->name) != 0) {
 | 
						if (strcmp(name, w->name) != 0) {
 | 
				
			||||||
		log_debug("@%u new name %s (was %s)", w->id, name, w->name);
 | 
							log_debug("@%u new name %s (was %s)", w->id, name, w->name);
 | 
				
			||||||
		window_set_name(w, name);
 | 
							window_set_name(w, name);
 | 
				
			||||||
 | 
							server_redraw_window_borders(w);
 | 
				
			||||||
		server_status_window(w);
 | 
							server_status_window(w);
 | 
				
			||||||
	} else
 | 
						} else
 | 
				
			||||||
		log_debug("@%u name not changed (still %s)", w->id, w->name);
 | 
							log_debug("@%u name not changed (still %s)", w->id, w->name);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -717,7 +717,7 @@ const struct options_table_entry options_table[] = {
 | 
				
			|||||||
	{ .name = "pane-active-border-style",
 | 
						{ .name = "pane-active-border-style",
 | 
				
			||||||
	  .type = OPTIONS_TABLE_STRING,
 | 
						  .type = OPTIONS_TABLE_STRING,
 | 
				
			||||||
	  .scope = OPTIONS_TABLE_WINDOW,
 | 
						  .scope = OPTIONS_TABLE_WINDOW,
 | 
				
			||||||
	  .default_str = "fg=green",
 | 
						  .default_str = "#{?pane_in_mode,fg=yellow,#{?synchronize-panes,fg=red,,fg=green}}",
 | 
				
			||||||
	  .flags = OPTIONS_TABLE_IS_STYLE,
 | 
						  .flags = OPTIONS_TABLE_IS_STYLE,
 | 
				
			||||||
	  .separator = ","
 | 
						  .separator = ","
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								window.c
									
									
									
									
									
								
							@@ -1109,6 +1109,7 @@ window_pane_set_mode(struct window_pane *wp, struct window_pane *swp,
 | 
				
			|||||||
	wp->screen = wme->screen;
 | 
						wp->screen = wme->screen;
 | 
				
			||||||
	wp->flags |= (PANE_REDRAW|PANE_CHANGED);
 | 
						wp->flags |= (PANE_REDRAW|PANE_CHANGED);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						server_redraw_window_borders(wp->window);
 | 
				
			||||||
	server_status_window(wp->window);
 | 
						server_status_window(wp->window);
 | 
				
			||||||
	notify_pane("pane-mode-changed", wp);
 | 
						notify_pane("pane-mode-changed", wp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1140,6 +1141,7 @@ window_pane_reset_mode(struct window_pane *wp)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	wp->flags |= (PANE_REDRAW|PANE_CHANGED);
 | 
						wp->flags |= (PANE_REDRAW|PANE_CHANGED);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						server_redraw_window_borders(wp->window);
 | 
				
			||||||
	server_status_window(wp->window);
 | 
						server_status_window(wp->window);
 | 
				
			||||||
	notify_pane("pane-mode-changed", wp);
 | 
						notify_pane("pane-mode-changed", wp);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user