mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	Instead of just checking for an empty buffer, which may not be the case if
there is unconsumed data, save the previous size and use it instead. This means that activity monitoring should work in this (unlikely) event. Also remove a debugging statement that no longer seems necessary.
This commit is contained in:
		
							
								
								
									
										10
									
								
								input.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								input.c
									
									
									
									
									
								
							| @@ -235,6 +235,8 @@ input_init(struct window_pane *wp) | |||||||
| 	ictx->saved_cy = 0; | 	ictx->saved_cy = 0; | ||||||
|  |  | ||||||
| 	input_state(ictx, input_state_first); | 	input_state(ictx, input_state_first); | ||||||
|  |  | ||||||
|  | 	ictx->was = 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| void | void | ||||||
| @@ -252,8 +254,9 @@ input_parse(struct window_pane *wp) | |||||||
| 	struct input_ctx	*ictx = &wp->ictx; | 	struct input_ctx	*ictx = &wp->ictx; | ||||||
| 	u_char			 ch; | 	u_char			 ch; | ||||||
|  |  | ||||||
| 	if (BUFFER_USED(wp->in) == 0) | 	if (BUFFER_USED(wp->in) == ictx->was) | ||||||
| 		return; | 		return; | ||||||
|  | 	wp->window->flags |= WINDOW_ACTIVITY; | ||||||
|  |  | ||||||
| 	ictx->buf = BUFFER_OUT(wp->in); | 	ictx->buf = BUFFER_OUT(wp->in); | ||||||
| 	ictx->len = BUFFER_USED(wp->in); | 	ictx->len = BUFFER_USED(wp->in); | ||||||
| @@ -261,15 +264,11 @@ input_parse(struct window_pane *wp) | |||||||
|  |  | ||||||
| 	ictx->wp = wp; | 	ictx->wp = wp; | ||||||
|  |  | ||||||
| 	log_debug2("entry; buffer=%zu", ictx->len); |  | ||||||
|  |  | ||||||
| 	if (wp->mode == NULL) | 	if (wp->mode == NULL) | ||||||
| 		screen_write_start(&ictx->ctx, wp, &wp->base); | 		screen_write_start(&ictx->ctx, wp, &wp->base); | ||||||
| 	else | 	else | ||||||
| 		screen_write_start(&ictx->ctx, NULL, &wp->base); | 		screen_write_start(&ictx->ctx, NULL, &wp->base); | ||||||
|  |  | ||||||
| 	if (ictx->off != ictx->len) |  | ||||||
| 		wp->window->flags |= WINDOW_ACTIVITY; |  | ||||||
| 	while (ictx->off < ictx->len) { | 	while (ictx->off < ictx->len) { | ||||||
| 		ch = ictx->buf[ictx->off++]; | 		ch = ictx->buf[ictx->off++]; | ||||||
| 		ictx->state(ch, ictx); | 		ictx->state(ch, ictx); | ||||||
| @@ -278,6 +277,7 @@ input_parse(struct window_pane *wp) | |||||||
| 	screen_write_stop(&ictx->ctx); | 	screen_write_stop(&ictx->ctx); | ||||||
|  |  | ||||||
| 	buffer_remove(wp->in, ictx->len); | 	buffer_remove(wp->in, ictx->len); | ||||||
|  | 	ictx->was = BUFFER_USED(wp->in); | ||||||
| } | } | ||||||
|  |  | ||||||
| void | void | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Nicholas Marriott
					Nicholas Marriott