diff --git a/format.c b/format.c index 19c4dc15..40957a59 100644 --- a/format.c +++ b/format.c @@ -518,7 +518,6 @@ 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 *cwd; char *cmd; size = 0; @@ -551,9 +550,7 @@ 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 = get_proc_cwd(wp->fd)) != NULL) - format_add(ft, "pane_current_path", "%s", cwd); - if ((cmd = get_proc_name(wp->fd, wp->tty)) != NULL) { + if ((cmd = format_get_command(wp)) != NULL) { format_add(ft, "pane_current_command", "%s", cmd); free(cmd); } diff --git a/procname.c b/procname.c index 1518c94b..ee9b99dc 100644 --- a/procname.c +++ b/procname.c @@ -37,7 +37,6 @@ struct kinfo_proc *cmp_procs(struct kinfo_proc *, struct kinfo_proc *); char *get_proc_name(int, char *); -char *get_proc_cwd(int); struct kinfo_proc * cmp_procs(struct kinfo_proc *p1, struct kinfo_proc *p2) @@ -132,17 +131,3 @@ error: free(buf); return (NULL); } - -char* -get_proc_cwd(int fd) -{ - int name[] = { CTL_KERN, KERN_PROC_CWD, 0 }; - static char path[MAXPATHLEN]; - size_t pathlen = sizeof path; - - if ((name[2] = tcgetpgrp(fd)) == -1) - return (NULL); - if (sysctl(name, 3, path, &pathlen, NULL, 0) != 0) - return (NULL); - return (path); -} diff --git a/tmux.1 b/tmux.1 index eb417da0..4fb588e3 100644 --- a/tmux.1 +++ b/tmux.1 @@ -3068,7 +3068,6 @@ The following variables are available, where appropriate: .It Li "mouse_utf8_flag" Ta "" Ta "Pane mouse UTF-8 flag" .It Li "pane_active" Ta "" Ta "1 if active pane" .It Li "pane_current_command" Ta "" Ta "Current command if available" -.It Li "pane_current_path" Ta "" Ta "Current path if available" .It Li "pane_dead" Ta "" Ta "1 if pane is dead" .It Li "pane_height" Ta "" Ta "Height of pane" .It Li "pane_id" Ta "#D" Ta "Unique pane ID" diff --git a/tmux.h b/tmux.h index e18176e8..67192740 100644 --- a/tmux.h +++ b/tmux.h @@ -2317,7 +2317,6 @@ u_int utf8_split2(u_int, u_char *); /* procname.c */ char *get_proc_name(int, char *); -char *get_proc_cwd(int); /* log.c */ void log_open(int, const char *);