From 1b28b2b51d264544a7c9490087561c9192459ba5 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 20 May 2022 08:49:05 +0100 Subject: Add pane_start_path to match start_command. --- format.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'format.c') diff --git a/format.c b/format.c index 5e04a6a2..ccd259ec 100644 --- a/format.c +++ b/format.c @@ -801,6 +801,20 @@ format_cb_start_command(struct format_tree *ft) 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. */ static void * 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, format_cb_start_command }, + { "pane_start_path", FORMAT_TABLE_STRING, + format_cb_start_path + }, { "pane_synchronized", FORMAT_TABLE_STRING, format_cb_pane_synchronized }, -- cgit