diff options
author | 2013-03-24 09:19:51 +0000 | |
---|---|---|
committer | 2013-03-24 09:19:51 +0000 | |
commit | 4ca6d3056157d0d0a1840dbe6bef3eaefc76db6f (patch) | |
tree | 474937980a1bdc59706a98758f0784e7add4bc47 /usr.bin/tmux | |
parent | Add support for focus notifications when tmux pane changes, based on (diff) | |
download | wireguard-openbsd-4ca6d3056157d0d0a1840dbe6bef3eaefc76db6f.tar.xz wireguard-openbsd-4ca6d3056157d0d0a1840dbe6bef3eaefc76db6f.zip |
Add pane_current_command format.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/format.c | 5 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.1 | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c index ba0c3ed779a..3e48726ac53 100644 --- a/usr.bin/tmux/format.c +++ b/usr.bin/tmux/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.16 2013/03/22 16:03:35 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.17 2013/03/24 09:19:51 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net> @@ -377,6 +377,7 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp) u_int i; u_int idx; const char *cwd; + const char *cmd; size = 0; for (i = 0; i < gd->hsize; i++) { @@ -410,6 +411,8 @@ format_window_pane(struct format_tree *ft, struct window_pane *wp) format_add(ft, "pane_start_path", "%s", wp->cwd); if ((cwd = get_proc_cwd(wp->fd)) != NULL) format_add(ft, "pane_current_path", "%s", cwd); + if ((cmd = osdep_get_name(wp->fd, wp->tty)) != NULL) + format_add(ft, "pane_current_command", "%s", cmd); format_add(ft, "cursor_x", "%d", wp->base.cx); format_add(ft, "cursor_y", "%d", wp->base.cy); diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1 index 53b66b4b348..d3575093990 100644 --- a/usr.bin/tmux/tmux.1 +++ b/usr.bin/tmux/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.330 2013/03/22 18:45:36 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.331 2013/03/24 09:19:51 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 22 2013 $ +.Dd $Mdocdate: March 24 2013 $ .Dt TMUX 1 .Os .Sh NAME @@ -3016,6 +3016,7 @@ The following variables are available, where appropriate: .It Li "mouse_standard_flag" Ta "Pane mouse standard flag" .It Li "mouse_utf8_flag" Ta "Pane mouse UTF-8 flag" .It Li "pane_active" Ta "1 if active pane" +.It Li "pane_current_command" Ta "Current command if available" .It Li "pane_current_path" Ta "Current path if available" .It Li "pane_dead" Ta "1 if pane is dead" .It Li "pane_height" Ta "Height of pane" |