mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		| @@ -273,6 +273,10 @@ server_client_lost(struct client *c) | |||||||
| 	if (event_initialized(&c->status_timer)) | 	if (event_initialized(&c->status_timer)) | ||||||
| 		evtimer_del(&c->status_timer); | 		evtimer_del(&c->status_timer); | ||||||
| 	screen_free(&c->status); | 	screen_free(&c->status); | ||||||
|  | 	if (c->old_status != NULL) { | ||||||
|  | 		screen_free(c->old_status); | ||||||
|  | 		free(c->old_status); | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	free(c->title); | 	free(c->title); | ||||||
| 	free((void *)c->cwd); | 	free((void *)c->cwd); | ||||||
|   | |||||||
							
								
								
									
										26
									
								
								status.c
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								status.c
									
									
									
									
									
								
							| @@ -301,6 +301,13 @@ status_redraw(struct client *c) | |||||||
| 	size_t			 llen, rlen, seplen; | 	size_t			 llen, rlen, seplen; | ||||||
| 	int			 larrow, rarrow; | 	int			 larrow, rarrow; | ||||||
|  |  | ||||||
|  | 	/* Delete the saved status line, if any. */ | ||||||
|  | 	if (c->old_status != NULL) { | ||||||
|  | 		screen_free(c->old_status); | ||||||
|  | 		free(c->old_status); | ||||||
|  | 		c->old_status = NULL; | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	/* No status line? */ | 	/* No status line? */ | ||||||
| 	if (c->tty.sy == 0 || !options_get_number(s->options, "status")) | 	if (c->tty.sy == 0 || !options_get_number(s->options, "status")) | ||||||
| 		return (1); | 		return (1); | ||||||
| @@ -568,6 +575,12 @@ status_message_set(struct client *c, const char *fmt, ...) | |||||||
|  |  | ||||||
| 	status_message_clear(c); | 	status_message_clear(c); | ||||||
|  |  | ||||||
|  | 	if (c->old_status == NULL) { | ||||||
|  | 		c->old_status = xmalloc(sizeof *c->old_status); | ||||||
|  | 		memcpy(c->old_status, &c->status, sizeof *c->old_status); | ||||||
|  | 		screen_init(&c->status, c->tty.sx, 1, 0); | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	va_start(ap, fmt); | 	va_start(ap, fmt); | ||||||
| 	xvasprintf(&c->message_string, fmt, ap); | 	xvasprintf(&c->message_string, fmt, ap); | ||||||
| 	va_end(ap); | 	va_end(ap); | ||||||
| @@ -664,13 +677,24 @@ status_prompt_set(struct client *c, const char *msg, const char *input, | |||||||
|  |  | ||||||
| 	ft = format_create(c, NULL, FORMAT_NONE, 0); | 	ft = format_create(c, NULL, FORMAT_NONE, 0); | ||||||
| 	format_defaults(ft, c, NULL, NULL, NULL); | 	format_defaults(ft, c, NULL, NULL, NULL); | ||||||
|  |  | ||||||
| 	t = time(NULL); | 	t = time(NULL); | ||||||
|  |  | ||||||
|  | 	if (input == NULL) | ||||||
|  | 		input = ""; | ||||||
|  | 	if (flags & PROMPT_NOFORMAT) | ||||||
|  | 		tmp = xstrdup(input); | ||||||
|  | 	else | ||||||
| 		tmp = format_expand_time(ft, input, t); | 		tmp = format_expand_time(ft, input, t); | ||||||
|  |  | ||||||
| 	status_message_clear(c); | 	status_message_clear(c); | ||||||
| 	status_prompt_clear(c); | 	status_prompt_clear(c); | ||||||
|  |  | ||||||
|  | 	if (c->old_status == NULL) { | ||||||
|  | 		c->old_status = xmalloc(sizeof *c->old_status); | ||||||
|  | 		memcpy(c->old_status, &c->status, sizeof *c->old_status); | ||||||
|  | 		screen_init(&c->status, c->tty.sx, 1, 0); | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	c->prompt_string = format_expand_time(ft, msg, t); | 	c->prompt_string = format_expand_time(ft, msg, t); | ||||||
|  |  | ||||||
| 	c->prompt_buffer = utf8_fromcstr(tmp); | 	c->prompt_buffer = utf8_fromcstr(tmp); | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								tmux.h
									
									
									
									
									
								
							| @@ -1332,6 +1332,8 @@ struct client { | |||||||
| 	struct event	 status_timer; | 	struct event	 status_timer; | ||||||
| 	struct screen	 status; | 	struct screen	 status; | ||||||
|  |  | ||||||
|  | 	struct screen	*old_status; | ||||||
|  |  | ||||||
| #define CLIENT_TERMINAL 0x1 | #define CLIENT_TERMINAL 0x1 | ||||||
| #define CLIENT_LOGIN 0x2 | #define CLIENT_LOGIN 0x2 | ||||||
| #define CLIENT_EXIT 0x4 | #define CLIENT_EXIT 0x4 | ||||||
| @@ -1380,6 +1382,7 @@ struct client { | |||||||
| #define PROMPT_SINGLE 0x1 | #define PROMPT_SINGLE 0x1 | ||||||
| #define PROMPT_NUMERIC 0x2 | #define PROMPT_NUMERIC 0x2 | ||||||
| #define PROMPT_INCREMENTAL 0x4 | #define PROMPT_INCREMENTAL 0x4 | ||||||
|  | #define PROMPT_NOFORMAT 0x8 | ||||||
| 	int		 prompt_flags; | 	int		 prompt_flags; | ||||||
|  |  | ||||||
| 	struct session	*session; | 	struct session	*session; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Thomas Adam
					Thomas Adam