diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-09 14:53:51 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-02-09 14:53:51 +0000 |
commit | 648ce2f56adc071f93516887cf4a4c32f631d54e (patch) | |
tree | c0d2438bd54d426e6dab3fbcd833ce3408adc215 /format.c | |
parent | 0648c587162da4eae0805e35805454c46be70321 (diff) | |
parent | 01da28efb112ef2096a80da616ca190d59ba9b52 (diff) | |
download | rtmux-648ce2f56adc071f93516887cf4a4c32f631d54e.tar.gz rtmux-648ce2f56adc071f93516887cf4a4c32f631d54e.tar.bz2 rtmux-648ce2f56adc071f93516887cf4a4c32f631d54e.zip |
Merge branch 'master' of ssh://git.code.sf.net/p/tmux/tmux-code
Diffstat (limited to 'format.c')
-rw-r--r-- | format.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -365,6 +365,7 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp) unsigned long long size; u_int i; u_int idx; + const char *cwd; size = 0; for (i = 0; i < gd->hsize; i++) { @@ -390,9 +391,11 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp) format_add(ft, "pane_start_command", "%s", wp->cmd); if (wp->cwd != NULL) format_add(ft, "pane_start_path", "%s", wp->cwd); - format_add(ft, "pane_current_path", "%s", osdep_get_cwd(wp->fd)); + if ((cwd = osdep_get_cwd(wp->fd)) != NULL) + format_add(ft, "pane_current_path", "%s", cwd); format_add(ft, "pane_pid", "%ld", (long) wp->pid); - format_add(ft, "pane_tty", "%s", wp->tty); + if (wp->tty != NULL) + format_add(ft, "pane_tty", "%s", wp->tty); } void |