mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Create a new context when copying instead of using the input context. The input
context may not exist yet.
This commit is contained in:
		@@ -1385,10 +1385,14 @@ window_copy_get_selection(struct window_pane *wp, size_t *len)
 | 
				
			|||||||
void
 | 
					void
 | 
				
			||||||
window_copy_copy_buffer(struct window_pane *wp, int idx, void *buf, size_t len)
 | 
					window_copy_copy_buffer(struct window_pane *wp, int idx, void *buf, size_t len)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	u_int	limit;
 | 
						u_int			limit;
 | 
				
			||||||
 | 
						struct screen_write_ctx	ctx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (options_get_number(&global_options, "set-clipboard"))
 | 
						if (options_get_number(&global_options, "set-clipboard")) {
 | 
				
			||||||
		screen_write_setselection(&wp->ictx.ctx, buf, len);
 | 
							screen_write_start(&ctx, wp, NULL);
 | 
				
			||||||
 | 
							screen_write_setselection(&ctx, buf, len);
 | 
				
			||||||
 | 
							screen_write_stop(&ctx);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (idx == -1) {
 | 
						if (idx == -1) {
 | 
				
			||||||
		limit = options_get_number(&global_options, "buffer-limit");
 | 
							limit = options_get_number(&global_options, "buffer-limit");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user