aboutsummaryrefslogtreecommitdiff
path: root/format.c
diff options
context:
space:
mode:
authornicm <nicm>2022-05-30 13:07:06 +0000
committernicm <nicm>2022-05-30 13:07:06 +0000
commit2f2bb82f5f9c7ba995e8c21a217926efbbb4c5e5 (patch)
treeefd647df7a1bc753ae07ae769de76ba7ff669aa3 /format.c
parent6a5d210e558ffe9d8ec9b84f06da07e69629db7b (diff)
downloadrtmux-2f2bb82f5f9c7ba995e8c21a217926efbbb4c5e5.tar.gz
rtmux-2f2bb82f5f9c7ba995e8c21a217926efbbb4c5e5.tar.bz2
rtmux-2f2bb82f5f9c7ba995e8c21a217926efbbb4c5e5.zip
Add pane_start_path to match start_command.
Diffstat (limited to 'format.c')
-rw-r--r--format.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/format.c b/format.c
index 24d03af0..d085e348 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
},