mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Tidy up a lot of &ictx->ctx by using a local variable.
This commit is contained in:
		
							
								
								
									
										133
									
								
								input.c
									
									
									
									
									
								
							
							
						
						
									
										133
									
								
								input.c
									
									
									
									
									
								
							| @@ -801,16 +801,17 @@ void | |||||||
| input_reset(struct window_pane *wp, int clear) | input_reset(struct window_pane *wp, int clear) | ||||||
| { | { | ||||||
| 	struct input_ctx	*ictx = wp->ictx; | 	struct input_ctx	*ictx = wp->ictx; | ||||||
|  | 	struct screen_write_ctx	*sctx = &ictx->ctx; | ||||||
|  |  | ||||||
| 	input_reset_cell(ictx); | 	input_reset_cell(ictx); | ||||||
|  |  | ||||||
| 	if (clear) { | 	if (clear) { | ||||||
| 		if (TAILQ_EMPTY(&wp->modes)) | 		if (TAILQ_EMPTY(&wp->modes)) | ||||||
| 			screen_write_start(&ictx->ctx, wp, &wp->base); | 			screen_write_start(sctx, wp, &wp->base); | ||||||
| 		else | 		else | ||||||
| 			screen_write_start(&ictx->ctx, NULL, &wp->base); | 			screen_write_start(sctx, NULL, &wp->base); | ||||||
| 		screen_write_reset(&ictx->ctx); | 		screen_write_reset(sctx); | ||||||
| 		screen_write_stop(&ictx->ctx); | 		screen_write_stop(sctx); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	input_clear(ictx); | 	input_clear(ictx); | ||||||
| @@ -846,6 +847,7 @@ void | |||||||
| input_parse(struct window_pane *wp) | input_parse(struct window_pane *wp) | ||||||
| { | { | ||||||
| 	struct input_ctx		*ictx = wp->ictx; | 	struct input_ctx		*ictx = wp->ictx; | ||||||
|  | 	struct screen_write_ctx		*sctx = &ictx->ctx; | ||||||
| 	const struct input_transition	*itr; | 	const struct input_transition	*itr; | ||||||
| 	struct evbuffer			*evb = wp->event->input; | 	struct evbuffer			*evb = wp->event->input; | ||||||
| 	u_char				*buf; | 	u_char				*buf; | ||||||
| @@ -862,9 +864,9 @@ input_parse(struct window_pane *wp) | |||||||
| 	 * update the tty. | 	 * update the tty. | ||||||
| 	 */ | 	 */ | ||||||
| 	if (TAILQ_EMPTY(&wp->modes)) | 	if (TAILQ_EMPTY(&wp->modes)) | ||||||
| 		screen_write_start(&ictx->ctx, wp, &wp->base); | 		screen_write_start(sctx, wp, &wp->base); | ||||||
| 	else | 	else | ||||||
| 		screen_write_start(&ictx->ctx, NULL, &wp->base); | 		screen_write_start(sctx, NULL, &wp->base); | ||||||
| 	ictx->wp = wp; | 	ictx->wp = wp; | ||||||
|  |  | ||||||
| 	buf = EVBUFFER_DATA(evb); | 	buf = EVBUFFER_DATA(evb); | ||||||
| @@ -900,7 +902,7 @@ input_parse(struct window_pane *wp) | |||||||
| 		 * be the minority. | 		 * be the minority. | ||||||
| 		 */ | 		 */ | ||||||
| 		if (itr->handler != input_print) | 		if (itr->handler != input_print) | ||||||
| 			screen_write_collect_end(&ictx->ctx); | 			screen_write_collect_end(sctx); | ||||||
|  |  | ||||||
| 		/* | 		/* | ||||||
| 		 * Execute the handler, if any. Don't switch state if it | 		 * Execute the handler, if any. Don't switch state if it | ||||||
| @@ -919,7 +921,7 @@ input_parse(struct window_pane *wp) | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	/* Close the screen. */ | 	/* Close the screen. */ | ||||||
| 	screen_write_stop(&ictx->ctx); | 	screen_write_stop(sctx); | ||||||
|  |  | ||||||
| 	evbuffer_drain(evb, len); | 	evbuffer_drain(evb, len); | ||||||
| } | } | ||||||
| @@ -1048,6 +1050,7 @@ input_ground(struct input_ctx *ictx) | |||||||
| static int | static int | ||||||
| input_print(struct input_ctx *ictx) | input_print(struct input_ctx *ictx) | ||||||
| { | { | ||||||
|  | 	struct screen_write_ctx	*sctx = &ictx->ctx; | ||||||
| 	int			 set; | 	int			 set; | ||||||
|  |  | ||||||
| 	ictx->utf8started = 0; /* can't be valid UTF-8 */ | 	ictx->utf8started = 0; /* can't be valid UTF-8 */ | ||||||
| @@ -1059,7 +1062,7 @@ input_print(struct input_ctx *ictx) | |||||||
| 		ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET; | 		ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET; | ||||||
|  |  | ||||||
| 	utf8_set(&ictx->cell.cell.data, ictx->ch); | 	utf8_set(&ictx->cell.cell.data, ictx->ch); | ||||||
| 	screen_write_collect_add(&ictx->ctx, &ictx->cell.cell); | 	screen_write_collect_add(sctx, &ictx->cell.cell); | ||||||
| 	ictx->last = ictx->ch; | 	ictx->last = ictx->ch; | ||||||
|  |  | ||||||
| 	ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET; | 	ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET; | ||||||
| @@ -1533,6 +1536,7 @@ input_csi_dispatch(struct input_ctx *ictx) | |||||||
| static void | static void | ||||||
| input_csi_dispatch_rm(struct input_ctx *ictx) | input_csi_dispatch_rm(struct input_ctx *ictx) | ||||||
| { | { | ||||||
|  | 	struct screen_write_ctx	*sctx = &ictx->ctx; | ||||||
| 	u_int			 i; | 	u_int			 i; | ||||||
|  |  | ||||||
| 	for (i = 0; i < ictx->param_list_len; i++) { | 	for (i = 0; i < ictx->param_list_len; i++) { | ||||||
| @@ -1540,10 +1544,10 @@ input_csi_dispatch_rm(struct input_ctx *ictx) | |||||||
| 		case -1: | 		case -1: | ||||||
| 			break; | 			break; | ||||||
| 		case 4:		/* IRM */ | 		case 4:		/* IRM */ | ||||||
| 			screen_write_mode_clear(&ictx->ctx, MODE_INSERT); | 			screen_write_mode_clear(sctx, MODE_INSERT); | ||||||
| 			break; | 			break; | ||||||
| 		case 34: | 		case 34: | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_BLINKING); | 			screen_write_mode_set(sctx, MODE_BLINKING); | ||||||
| 			break; | 			break; | ||||||
| 		default: | 		default: | ||||||
| 			log_debug("%s: unknown '%c'", __func__, ictx->ch); | 			log_debug("%s: unknown '%c'", __func__, ictx->ch); | ||||||
| @@ -1556,6 +1560,7 @@ input_csi_dispatch_rm(struct input_ctx *ictx) | |||||||
| static void | static void | ||||||
| input_csi_dispatch_rm_private(struct input_ctx *ictx) | input_csi_dispatch_rm_private(struct input_ctx *ictx) | ||||||
| { | { | ||||||
|  | 	struct screen_write_ctx	*sctx = &ictx->ctx; | ||||||
| 	struct window_pane	*wp = ictx->wp; | 	struct window_pane	*wp = ictx->wp; | ||||||
| 	u_int			 i; | 	u_int			 i; | ||||||
|  |  | ||||||
| @@ -1564,40 +1569,39 @@ input_csi_dispatch_rm_private(struct input_ctx *ictx) | |||||||
| 		case -1: | 		case -1: | ||||||
| 			break; | 			break; | ||||||
| 		case 1:		/* DECCKM */ | 		case 1:		/* DECCKM */ | ||||||
| 			screen_write_mode_clear(&ictx->ctx, MODE_KCURSOR); | 			screen_write_mode_clear(sctx, MODE_KCURSOR); | ||||||
| 			break; | 			break; | ||||||
| 		case 3:		/* DECCOLM */ | 		case 3:		/* DECCOLM */ | ||||||
| 			screen_write_cursormove(&ictx->ctx, 0, 0); | 			screen_write_cursormove(sctx, 0, 0); | ||||||
| 			screen_write_clearscreen(&ictx->ctx, | 			screen_write_clearscreen(sctx, ictx->cell.cell.bg); | ||||||
| 			    ictx->cell.cell.bg); |  | ||||||
| 			break; | 			break; | ||||||
| 		case 6:		/* DECOM */ | 		case 6:		/* DECOM */ | ||||||
| 			screen_write_mode_clear(&ictx->ctx, MODE_ORIGIN); | 			screen_write_mode_clear(sctx, MODE_ORIGIN); | ||||||
| 			screen_write_cursormove(&ictx->ctx, 0, 0); | 			screen_write_cursormove(sctx, 0, 0); | ||||||
| 			break; | 			break; | ||||||
| 		case 7:		/* DECAWM */ | 		case 7:		/* DECAWM */ | ||||||
| 			screen_write_mode_clear(&ictx->ctx, MODE_WRAP); | 			screen_write_mode_clear(sctx, MODE_WRAP); | ||||||
| 			break; | 			break; | ||||||
| 		case 12: | 		case 12: | ||||||
| 			screen_write_mode_clear(&ictx->ctx, MODE_BLINKING); | 			screen_write_mode_clear(sctx, MODE_BLINKING); | ||||||
| 			break; | 			break; | ||||||
| 		case 25:	/* TCEM */ | 		case 25:	/* TCEM */ | ||||||
| 			screen_write_mode_clear(&ictx->ctx, MODE_CURSOR); | 			screen_write_mode_clear(sctx, MODE_CURSOR); | ||||||
| 			break; | 			break; | ||||||
| 		case 1000: | 		case 1000: | ||||||
| 		case 1001: | 		case 1001: | ||||||
| 		case 1002: | 		case 1002: | ||||||
| 		case 1003: | 		case 1003: | ||||||
| 			screen_write_mode_clear(&ictx->ctx, ALL_MOUSE_MODES); | 			screen_write_mode_clear(sctx, ALL_MOUSE_MODES); | ||||||
| 			break; | 			break; | ||||||
| 		case 1004: | 		case 1004: | ||||||
| 			screen_write_mode_clear(&ictx->ctx, MODE_FOCUSON); | 			screen_write_mode_clear(sctx, MODE_FOCUSON); | ||||||
| 			break; | 			break; | ||||||
| 		case 1005: | 		case 1005: | ||||||
| 			screen_write_mode_clear(&ictx->ctx, MODE_MOUSE_UTF8); | 			screen_write_mode_clear(sctx, MODE_MOUSE_UTF8); | ||||||
| 			break; | 			break; | ||||||
| 		case 1006: | 		case 1006: | ||||||
| 			screen_write_mode_clear(&ictx->ctx, MODE_MOUSE_SGR); | 			screen_write_mode_clear(sctx, MODE_MOUSE_SGR); | ||||||
| 			break; | 			break; | ||||||
| 		case 47: | 		case 47: | ||||||
| 		case 1047: | 		case 1047: | ||||||
| @@ -1607,7 +1611,7 @@ input_csi_dispatch_rm_private(struct input_ctx *ictx) | |||||||
| 			window_pane_alternate_off(wp, &ictx->cell.cell, 1); | 			window_pane_alternate_off(wp, &ictx->cell.cell, 1); | ||||||
| 			break; | 			break; | ||||||
| 		case 2004: | 		case 2004: | ||||||
| 			screen_write_mode_clear(&ictx->ctx, MODE_BRACKETPASTE); | 			screen_write_mode_clear(sctx, MODE_BRACKETPASTE); | ||||||
| 			break; | 			break; | ||||||
| 		default: | 		default: | ||||||
| 			log_debug("%s: unknown '%c'", __func__, ictx->ch); | 			log_debug("%s: unknown '%c'", __func__, ictx->ch); | ||||||
| @@ -1620,6 +1624,7 @@ input_csi_dispatch_rm_private(struct input_ctx *ictx) | |||||||
| static void | static void | ||||||
| input_csi_dispatch_sm(struct input_ctx *ictx) | input_csi_dispatch_sm(struct input_ctx *ictx) | ||||||
| { | { | ||||||
|  | 	struct screen_write_ctx	*sctx = &ictx->ctx; | ||||||
| 	u_int			 i; | 	u_int			 i; | ||||||
|  |  | ||||||
| 	for (i = 0; i < ictx->param_list_len; i++) { | 	for (i = 0; i < ictx->param_list_len; i++) { | ||||||
| @@ -1627,10 +1632,10 @@ input_csi_dispatch_sm(struct input_ctx *ictx) | |||||||
| 		case -1: | 		case -1: | ||||||
| 			break; | 			break; | ||||||
| 		case 4:		/* IRM */ | 		case 4:		/* IRM */ | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_INSERT); | 			screen_write_mode_set(sctx, MODE_INSERT); | ||||||
| 			break; | 			break; | ||||||
| 		case 34: | 		case 34: | ||||||
| 			screen_write_mode_clear(&ictx->ctx, MODE_BLINKING); | 			screen_write_mode_clear(sctx, MODE_BLINKING); | ||||||
| 			break; | 			break; | ||||||
| 		default: | 		default: | ||||||
| 			log_debug("%s: unknown '%c'", __func__, ictx->ch); | 			log_debug("%s: unknown '%c'", __func__, ictx->ch); | ||||||
| @@ -1643,6 +1648,7 @@ input_csi_dispatch_sm(struct input_ctx *ictx) | |||||||
| static void | static void | ||||||
| input_csi_dispatch_sm_private(struct input_ctx *ictx) | input_csi_dispatch_sm_private(struct input_ctx *ictx) | ||||||
| { | { | ||||||
|  | 	struct screen_write_ctx	*sctx = &ictx->ctx; | ||||||
| 	struct window_pane	*wp = ictx->wp; | 	struct window_pane	*wp = ictx->wp; | ||||||
| 	u_int			 i; | 	u_int			 i; | ||||||
|  |  | ||||||
| @@ -1651,49 +1657,48 @@ input_csi_dispatch_sm_private(struct input_ctx *ictx) | |||||||
| 		case -1: | 		case -1: | ||||||
| 			break; | 			break; | ||||||
| 		case 1:		/* DECCKM */ | 		case 1:		/* DECCKM */ | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_KCURSOR); | 			screen_write_mode_set(sctx, MODE_KCURSOR); | ||||||
| 			break; | 			break; | ||||||
| 		case 3:		/* DECCOLM */ | 		case 3:		/* DECCOLM */ | ||||||
| 			screen_write_cursormove(&ictx->ctx, 0, 0); | 			screen_write_cursormove(sctx, 0, 0); | ||||||
| 			screen_write_clearscreen(&ictx->ctx, | 			screen_write_clearscreen(sctx, ictx->cell.cell.bg); | ||||||
| 			    ictx->cell.cell.bg); |  | ||||||
| 			break; | 			break; | ||||||
| 		case 6:		/* DECOM */ | 		case 6:		/* DECOM */ | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_ORIGIN); | 			screen_write_mode_set(sctx, MODE_ORIGIN); | ||||||
| 			screen_write_cursormove(&ictx->ctx, 0, 0); | 			screen_write_cursormove(sctx, 0, 0); | ||||||
| 			break; | 			break; | ||||||
| 		case 7:		/* DECAWM */ | 		case 7:		/* DECAWM */ | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_WRAP); | 			screen_write_mode_set(sctx, MODE_WRAP); | ||||||
| 			break; | 			break; | ||||||
| 		case 12: | 		case 12: | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_BLINKING); | 			screen_write_mode_set(sctx, MODE_BLINKING); | ||||||
| 			break; | 			break; | ||||||
| 		case 25:	/* TCEM */ | 		case 25:	/* TCEM */ | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_CURSOR); | 			screen_write_mode_set(sctx, MODE_CURSOR); | ||||||
| 			break; | 			break; | ||||||
| 		case 1000: | 		case 1000: | ||||||
| 			screen_write_mode_clear(&ictx->ctx, ALL_MOUSE_MODES); | 			screen_write_mode_clear(sctx, ALL_MOUSE_MODES); | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_MOUSE_STANDARD); | 			screen_write_mode_set(sctx, MODE_MOUSE_STANDARD); | ||||||
| 			break; | 			break; | ||||||
| 		case 1002: | 		case 1002: | ||||||
| 			screen_write_mode_clear(&ictx->ctx, ALL_MOUSE_MODES); | 			screen_write_mode_clear(sctx, ALL_MOUSE_MODES); | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_MOUSE_BUTTON); | 			screen_write_mode_set(sctx, MODE_MOUSE_BUTTON); | ||||||
| 			break; | 			break; | ||||||
| 		case 1003: | 		case 1003: | ||||||
| 			screen_write_mode_clear(&ictx->ctx, ALL_MOUSE_MODES); | 			screen_write_mode_clear(sctx, ALL_MOUSE_MODES); | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_MOUSE_ALL); | 			screen_write_mode_set(sctx, MODE_MOUSE_ALL); | ||||||
| 			break; | 			break; | ||||||
| 		case 1004: | 		case 1004: | ||||||
| 			if (ictx->ctx.s->mode & MODE_FOCUSON) | 			if (sctx->s->mode & MODE_FOCUSON) | ||||||
| 				break; | 				break; | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_FOCUSON); | 			screen_write_mode_set(sctx, MODE_FOCUSON); | ||||||
| 			wp->flags |= PANE_FOCUSPUSH; /* force update */ | 			wp->flags |= PANE_FOCUSPUSH; /* force update */ | ||||||
| 			break; | 			break; | ||||||
| 		case 1005: | 		case 1005: | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_MOUSE_UTF8); | 			screen_write_mode_set(sctx, MODE_MOUSE_UTF8); | ||||||
| 			break; | 			break; | ||||||
| 		case 1006: | 		case 1006: | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_MOUSE_SGR); | 			screen_write_mode_set(sctx, MODE_MOUSE_SGR); | ||||||
| 			break; | 			break; | ||||||
| 		case 47: | 		case 47: | ||||||
| 		case 1047: | 		case 1047: | ||||||
| @@ -1703,7 +1708,7 @@ input_csi_dispatch_sm_private(struct input_ctx *ictx) | |||||||
| 			window_pane_alternate_on(wp, &ictx->cell.cell, 1); | 			window_pane_alternate_on(wp, &ictx->cell.cell, 1); | ||||||
| 			break; | 			break; | ||||||
| 		case 2004: | 		case 2004: | ||||||
| 			screen_write_mode_set(&ictx->ctx, MODE_BRACKETPASTE); | 			screen_write_mode_set(sctx, MODE_BRACKETPASTE); | ||||||
| 			break; | 			break; | ||||||
| 		default: | 		default: | ||||||
| 			log_debug("%s: unknown '%c'", __func__, ictx->ch); | 			log_debug("%s: unknown '%c'", __func__, ictx->ch); | ||||||
| @@ -1716,6 +1721,7 @@ input_csi_dispatch_sm_private(struct input_ctx *ictx) | |||||||
| static void | static void | ||||||
| input_csi_dispatch_winops(struct input_ctx *ictx) | input_csi_dispatch_winops(struct input_ctx *ictx) | ||||||
| { | { | ||||||
|  | 	struct screen_write_ctx	*sctx = &ictx->ctx; | ||||||
| 	struct window_pane	*wp = ictx->wp; | 	struct window_pane	*wp = ictx->wp; | ||||||
| 	int			 n, m; | 	int			 n, m; | ||||||
|  |  | ||||||
| @@ -1755,7 +1761,7 @@ input_csi_dispatch_winops(struct input_ctx *ictx) | |||||||
| 				return; | 				return; | ||||||
| 			case 0: | 			case 0: | ||||||
| 			case 2: | 			case 2: | ||||||
| 				screen_push_title(ictx->ctx.s); | 				screen_push_title(sctx->s); | ||||||
| 				break; | 				break; | ||||||
| 			} | 			} | ||||||
| 			break; | 			break; | ||||||
| @@ -1766,7 +1772,7 @@ input_csi_dispatch_winops(struct input_ctx *ictx) | |||||||
| 				return; | 				return; | ||||||
| 			case 0: | 			case 0: | ||||||
| 			case 2: | 			case 2: | ||||||
| 				screen_pop_title(ictx->ctx.s); | 				screen_pop_title(sctx->s); | ||||||
| 				server_status_window(ictx->wp->window); | 				server_status_window(ictx->wp->window); | ||||||
| 				break; | 				break; | ||||||
| 			} | 			} | ||||||
| @@ -2089,20 +2095,19 @@ input_enter_dcs(struct input_ctx *ictx) | |||||||
| static int | static int | ||||||
| input_dcs_dispatch(struct input_ctx *ictx) | input_dcs_dispatch(struct input_ctx *ictx) | ||||||
| { | { | ||||||
|  | 	struct screen_write_ctx	*sctx = &ictx->ctx; | ||||||
|  | 	u_char			*buf = ictx->input_buf; | ||||||
|  | 	size_t			 len = ictx->input_len; | ||||||
| 	const char		 prefix[] = "tmux;"; | 	const char		 prefix[] = "tmux;"; | ||||||
| 	const u_int	prefix_len = (sizeof prefix) - 1; | 	const u_int		 prefixlen = (sizeof prefix) - 1; | ||||||
|  |  | ||||||
| 	if (ictx->flags & INPUT_DISCARD) | 	if (ictx->flags & INPUT_DISCARD) | ||||||
| 		return (0); | 		return (0); | ||||||
|  |  | ||||||
| 	log_debug("%s: \"%s\"", __func__, ictx->input_buf); | 	log_debug("%s: \"%s\"", __func__, buf); | ||||||
|  |  | ||||||
| 	/* Check for tmux prefix. */ | 	if (len >= prefixlen && strncmp(buf, prefix, prefixlen) == 0) | ||||||
| 	if (ictx->input_len >= prefix_len && | 		screen_write_rawstring(sctx, buf + prefixlen, len - prefixlen); | ||||||
| 	    strncmp(ictx->input_buf, prefix, prefix_len) == 0) { |  | ||||||
| 		screen_write_rawstring(&ictx->ctx, |  | ||||||
| 		    ictx->input_buf + prefix_len, ictx->input_len - prefix_len); |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	return (0); | 	return (0); | ||||||
| } | } | ||||||
| @@ -2122,6 +2127,7 @@ input_enter_osc(struct input_ctx *ictx) | |||||||
| static void | static void | ||||||
| input_exit_osc(struct input_ctx *ictx) | input_exit_osc(struct input_ctx *ictx) | ||||||
| { | { | ||||||
|  | 	struct screen_write_ctx	*sctx = &ictx->ctx; | ||||||
| 	u_char			*p = ictx->input_buf; | 	u_char			*p = ictx->input_buf; | ||||||
| 	u_int			 option; | 	u_int			 option; | ||||||
|  |  | ||||||
| @@ -2143,7 +2149,7 @@ input_exit_osc(struct input_ctx *ictx) | |||||||
| 	case 0: | 	case 0: | ||||||
| 	case 2: | 	case 2: | ||||||
| 		if (utf8_isvalid(p)) { | 		if (utf8_isvalid(p)) { | ||||||
| 			screen_set_title(ictx->ctx.s, p); | 			screen_set_title(sctx->s, p); | ||||||
| 			server_status_window(ictx->wp->window); | 			server_status_window(ictx->wp->window); | ||||||
| 		} | 		} | ||||||
| 		break; | 		break; | ||||||
| @@ -2158,7 +2164,7 @@ input_exit_osc(struct input_ctx *ictx) | |||||||
| 		break; | 		break; | ||||||
| 	case 12: | 	case 12: | ||||||
| 		if (utf8_isvalid(p) && *p != '?') /* ? is colour request */ | 		if (utf8_isvalid(p) && *p != '?') /* ? is colour request */ | ||||||
| 			screen_set_cursor_colour(ictx->ctx.s, p); | 			screen_set_cursor_colour(sctx->s, p); | ||||||
| 		break; | 		break; | ||||||
| 	case 52: | 	case 52: | ||||||
| 		input_osc_52(ictx, p); | 		input_osc_52(ictx, p); | ||||||
| @@ -2168,7 +2174,7 @@ input_exit_osc(struct input_ctx *ictx) | |||||||
| 		break; | 		break; | ||||||
| 	case 112: | 	case 112: | ||||||
| 		if (*p == '\0') /* no arguments allowed */ | 		if (*p == '\0') /* no arguments allowed */ | ||||||
| 			screen_set_cursor_colour(ictx->ctx.s, ""); | 			screen_set_cursor_colour(sctx->s, ""); | ||||||
| 		break; | 		break; | ||||||
| 	default: | 	default: | ||||||
| 		log_debug("%s: unknown '%u'", __func__, option); | 		log_debug("%s: unknown '%u'", __func__, option); | ||||||
| @@ -2191,13 +2197,15 @@ input_enter_apc(struct input_ctx *ictx) | |||||||
| static void | static void | ||||||
| input_exit_apc(struct input_ctx *ictx) | input_exit_apc(struct input_ctx *ictx) | ||||||
| { | { | ||||||
|  | 	struct screen_write_ctx	*sctx = &ictx->ctx; | ||||||
|  |  | ||||||
| 	if (ictx->flags & INPUT_DISCARD) | 	if (ictx->flags & INPUT_DISCARD) | ||||||
| 		return; | 		return; | ||||||
| 	log_debug("%s: \"%s\"", __func__, ictx->input_buf); | 	log_debug("%s: \"%s\"", __func__, ictx->input_buf); | ||||||
|  |  | ||||||
| 	if (!utf8_isvalid(ictx->input_buf)) | 	if (!utf8_isvalid(ictx->input_buf)) | ||||||
| 		return; | 		return; | ||||||
| 	screen_set_title(ictx->ctx.s, ictx->input_buf); | 	screen_set_title(sctx->s, ictx->input_buf); | ||||||
| 	server_status_window(ictx->wp->window); | 	server_status_window(ictx->wp->window); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -2233,6 +2241,7 @@ input_exit_rename(struct input_ctx *ictx) | |||||||
| static int | static int | ||||||
| input_top_bit_set(struct input_ctx *ictx) | input_top_bit_set(struct input_ctx *ictx) | ||||||
| { | { | ||||||
|  | 	struct screen_write_ctx	*sctx = &ictx->ctx; | ||||||
| 	struct utf8_data	*ud = &ictx->utf8data; | 	struct utf8_data	*ud = &ictx->utf8data; | ||||||
|  |  | ||||||
| 	ictx->last = -1; | 	ictx->last = -1; | ||||||
| @@ -2259,7 +2268,7 @@ input_top_bit_set(struct input_ctx *ictx) | |||||||
| 	    (int)ud->size, ud->data, ud->width); | 	    (int)ud->size, ud->data, ud->width); | ||||||
|  |  | ||||||
| 	utf8_copy(&ictx->cell.cell.data, ud); | 	utf8_copy(&ictx->cell.cell.data, ud); | ||||||
| 	screen_write_collect_add(&ictx->ctx, &ictx->cell.cell); | 	screen_write_collect_add(sctx, &ictx->cell.cell); | ||||||
|  |  | ||||||
| 	return (0); | 	return (0); | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 nicm
					nicm