=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/format.c,v retrieving revision 1.84 retrieving revision 1.85 diff -u -r1.84 -r1.85 --- src/usr.bin/tmux/format.c 2015/09/14 10:25:52 1.84 +++ src/usr.bin/tmux/format.c 2015/10/23 16:02:21 1.85 @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.84 2015/09/14 10:25:52 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.85 2015/10/23 16:02:21 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott @@ -1005,7 +1005,7 @@ { struct grid *gd = wp->base.grid; u_int idx; - int status; + int status, scroll_position; if (ft->w == NULL) ft->w = wp->window; @@ -1051,6 +1051,10 @@ format_add(ft, "cursor_y", "%u", wp->base.cy); format_add(ft, "scroll_region_upper", "%u", wp->base.rupper); format_add(ft, "scroll_region_lower", "%u", wp->base.rlower); + + scroll_position = window_copy_scroll_position(wp); + if (scroll_position != -1) + format_add(ft, "scroll_position", "%d", scroll_position); format_add(ft, "alternate_on", "%d", wp->saved_grid ? 1 : 0); format_add(ft, "alternate_saved_x", "%u", wp->saved_cx);