mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 01:34:18 +00:00 
			
		
		
		
	Add pane_start_path to match start_command.
This commit is contained in:
		
							
								
								
									
										17
									
								
								format.c
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								format.c
									
									
									
									
									
								
							@@ -801,6 +801,20 @@ format_cb_start_command(struct format_tree *ft)
 | 
				
			|||||||
	return (cmd_stringify_argv(wp->argc, wp->argv));
 | 
						return (cmd_stringify_argv(wp->argc, wp->argv));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* Callback for pane_start_path. */
 | 
				
			||||||
 | 
					static void *
 | 
				
			||||||
 | 
					format_cb_start_path(struct format_tree *ft)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						struct window_pane	*wp = ft->wp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (wp == NULL)
 | 
				
			||||||
 | 
							return (NULL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (wp->cwd == NULL)
 | 
				
			||||||
 | 
							return (xstrdup(""));
 | 
				
			||||||
 | 
						return (xstrdup(wp->cwd));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Callback for pane_current_command. */
 | 
					/* Callback for pane_current_command. */
 | 
				
			||||||
static void *
 | 
					static void *
 | 
				
			||||||
format_cb_current_command(struct format_tree *ft)
 | 
					format_cb_current_command(struct format_tree *ft)
 | 
				
			||||||
@@ -2898,6 +2912,9 @@ static const struct format_table_entry format_table[] = {
 | 
				
			|||||||
	{ "pane_start_command", FORMAT_TABLE_STRING,
 | 
						{ "pane_start_command", FORMAT_TABLE_STRING,
 | 
				
			||||||
	  format_cb_start_command
 | 
						  format_cb_start_command
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
						{ "pane_start_path", FORMAT_TABLE_STRING,
 | 
				
			||||||
 | 
						  format_cb_start_path
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	{ "pane_synchronized", FORMAT_TABLE_STRING,
 | 
						{ "pane_synchronized", FORMAT_TABLE_STRING,
 | 
				
			||||||
	  format_cb_pane_synchronized
 | 
						  format_cb_pane_synchronized
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								tmux.1
									
									
									
									
									
								
							@@ -5195,6 +5195,7 @@ The following variables are available, where appropriate:
 | 
				
			|||||||
.It Li "pane_right" Ta "" Ta "Right of pane"
 | 
					.It Li "pane_right" Ta "" Ta "Right of pane"
 | 
				
			||||||
.It Li "pane_search_string" Ta "" Ta "Last search string in copy mode"
 | 
					.It Li "pane_search_string" Ta "" Ta "Last search string in copy mode"
 | 
				
			||||||
.It Li "pane_start_command" Ta "" Ta "Command pane started with"
 | 
					.It Li "pane_start_command" Ta "" Ta "Command pane started with"
 | 
				
			||||||
 | 
					.It Li "pane_start_path" Ta "" Ta "Path pane started with"
 | 
				
			||||||
.It Li "pane_synchronized" Ta "" Ta "1 if pane is synchronized"
 | 
					.It Li "pane_synchronized" Ta "" Ta "1 if pane is synchronized"
 | 
				
			||||||
.It Li "pane_tabs" Ta "" Ta "Pane tab positions"
 | 
					.It Li "pane_tabs" Ta "" Ta "Pane tab positions"
 | 
				
			||||||
.It Li "pane_title" Ta "#T" Ta "Title of pane (can be set by application)"
 | 
					.It Li "pane_title" Ta "#T" Ta "Title of pane (can be set by application)"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user