summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-07-27 10:42:06 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-07-27 10:42:06 +0000
commit56f4d825714ca92ff62cb8025c191078db59b42f (patch)
tree4b0c1c9c2ace77fd4f70db0624cf7f8c8ed9d7a1
parentceb0c350eefe0e7d288803b06323b43fde188a3d (diff)
Add pane_at_left/right/top/bottom formats, from Amos Bird.
-rw-r--r--usr.bin/tmux/format.c6
-rw-r--r--usr.bin/tmux/tmux.19
2 files changed, 11 insertions, 4 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index 234acff6215..bfe5b688028 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.143 2017/07/07 14:39:45 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.144 2017/07/27 10:42:05 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1405,6 +1405,10 @@ format_defaults_pane(struct format_tree *ft, struct window_pane *wp)
format_add(ft, "pane_top", "%u", wp->yoff);
format_add(ft, "pane_right", "%u", wp->xoff + wp->sx - 1);
format_add(ft, "pane_bottom", "%u", wp->yoff + wp->sy - 1);
+ format_add(ft, "pane_at_left", "%d", wp->xoff == 0);
+ format_add(ft, "pane_at_top", "%d", wp->yoff == 0);
+ format_add(ft, "pane_at_right", "%d", wp->xoff + wp->sx == wp->window->sx);
+ format_add(ft, "pane_at_bottom", "%d", wp->yoff + wp->sy == wp->window->sy);
}
format_add(ft, "pane_in_mode", "%d", wp->screen != &wp->base);
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index 159073a13fa..b1321b94554 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.569 2017/07/26 16:14:08 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.570 2017/07/27 10:42:05 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
@@ -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: July 26 2017 $
+.Dd $Mdocdate: July 27 2017 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -2774,7 +2774,6 @@ Set action on window silence when
is on.
The values are the same as those for
.Ic activity-action .
-.Pp
.It Xo Ic status
.Op Ic on | off
.Xc
@@ -3610,6 +3609,10 @@ The following variables are available, where appropriate:
.It Li "mouse_standard_flag" Ta "" Ta "Pane mouse standard flag"
.It Li "mouse_all_flag" Ta "" Ta "Pane mouse all flag"
.It Li "pane_active" Ta "" Ta "1 if active pane"
+.It Li "pane_at_bottom" Ta "" Ta "1 if pane is at the bottom of window"
+.It Li "pane_at_left" Ta "" Ta "1 if pane is at the left of window"
+.It Li "pane_at_right" Ta "" Ta "1 if pane is at the right of window"
+.It Li "pane_at_top" Ta "" Ta "1 if pane is at the top of window"
.It Li "pane_bottom" Ta "" Ta "Bottom of pane"
.It Li "pane_current_command" Ta "" Ta "Current command if available"
.It Li "pane_dead" Ta "" Ta "1 if pane is dead"