mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 17:24:18 +00:00 
			
		
		
		
	Add formats for cursor and selection position in copy mode, from Jason Felice.
This commit is contained in:
		
							
								
								
									
										6
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								tmux.1
									
									
									
									
									
								
							@@ -4214,6 +4214,8 @@ The following variables are available, where appropriate:
 | 
			
		||||
.It Li "command_list_alias" Ta "" Ta "Command alias if listing commands"
 | 
			
		||||
.It Li "command_list_name" Ta "" Ta "Command name if listing commands"
 | 
			
		||||
.It Li "command_list_usage" Ta "" Ta "Command usage if listing commands"
 | 
			
		||||
.It Li "copy_cursor_x" Ta "" Ta "Cursor X position in copy mode"
 | 
			
		||||
.It Li "copy_cursor_y" Ta "" Ta "Cursor Y position in copy mode"
 | 
			
		||||
.It Li "cursor_character" Ta "" Ta "Character at cursor in pane"
 | 
			
		||||
.It Li "cursor_flag" Ta "" Ta "Pane cursor flag"
 | 
			
		||||
.It Li "cursor_x" Ta "" Ta "Cursor X position in pane"
 | 
			
		||||
@@ -4279,7 +4281,11 @@ The following variables are available, where appropriate:
 | 
			
		||||
.It Li "scroll_position" Ta "" Ta "Scroll position in copy mode"
 | 
			
		||||
.It Li "scroll_region_lower" Ta "" Ta "Bottom of scroll region in pane"
 | 
			
		||||
.It Li "scroll_region_upper" Ta "" Ta "Top of scroll region in pane"
 | 
			
		||||
.It Li "selection_end_x" Ta "" Ta "X position of the end of the selection"
 | 
			
		||||
.It Li "selection_end_y" Ta "" Ta "Y position of the end of the selection"
 | 
			
		||||
.It Li "selection_present" Ta "" Ta "1 if selection started in copy mode"
 | 
			
		||||
.It Li "selection_start_x" Ta "" Ta "X position of the start of the selection"
 | 
			
		||||
.It Li "selection_start_y" Ta "" Ta "Y position of the start of the selection"
 | 
			
		||||
.It Li "session_activity" Ta "" Ta "Time of session last activity"
 | 
			
		||||
.It Li "session_alerts" Ta "" Ta "List of window indexes with alerts"
 | 
			
		||||
.It Li "session_attached" Ta "" Ta "Number of clients session is attached to"
 | 
			
		||||
 
 | 
			
		||||
@@ -565,9 +565,19 @@ window_copy_formats(struct window_mode_entry *wme, struct format_tree *ft)
 | 
			
		||||
{
 | 
			
		||||
	struct window_copy_mode_data	*data = wme->data;
 | 
			
		||||
 | 
			
		||||
	format_add(ft, "selection_present", "%d", data->screen.sel != NULL);
 | 
			
		||||
	format_add(ft, "scroll_position", "%d", data->oy);
 | 
			
		||||
	format_add(ft, "rectangle_toggle", "%d", data->rectflag);
 | 
			
		||||
 | 
			
		||||
	format_add(ft, "copy_cursor_x", "%d", data->cx);
 | 
			
		||||
	format_add(ft, "copy_cursor_y", "%d", data->cy);
 | 
			
		||||
 | 
			
		||||
	format_add(ft, "selection_present", "%d", data->screen.sel != NULL);
 | 
			
		||||
	if (data->screen.sel != NULL) {
 | 
			
		||||
		format_add(ft, "selection_start_x", "%d", data->selx);
 | 
			
		||||
		format_add(ft, "selection_start_y", "%d", data->sely);
 | 
			
		||||
		format_add(ft, "selection_end_x", "%d", data->endselx);
 | 
			
		||||
		format_add(ft, "selection_end_y", "%d", data->endsely);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user