aboutsummaryrefslogtreecommitdiff
path: root/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'format.c')
-rw-r--r--format.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/format.c b/format.c
index 450e15f3..1e89b2d2 100644
--- a/format.c
+++ b/format.c
@@ -523,6 +523,7 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp)
struct grid_line *gl;
unsigned long long size;
u_int i, idx;
+ const char *cmd;
char *cmd;
size = 0;
@@ -555,6 +556,8 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp)
format_add(ft, "pane_pid", "%ld", (long) wp->pid);
if (wp->cmd != NULL)
format_add(ft, "pane_start_command", "%s", wp->cmd);
+ if ((cwd = osdep_get_cwd(wp->fd)) != NULL)
+ format_add(ft, "pane_current_path", "%s", cwd);
if ((cmd = format_get_command(wp)) != NULL) {
format_add(ft, "pane_current_command", "%s", cmd);
free(cmd);