diff --git a/grid.c b/grid.c
index 05d6273..aabf66c 100644
--- a/grid.c
+++ b/grid.c
@@ -460,3 +460,44 @@ grid_duplicate_lines(
 		dy++;
 	}
 }
+
+/*
+ * Reflow lines from src grid into dst grid based on width sx. Returns number
+ * of lines fewer in the visible area, or zero.
+ */
+u_int
+grid_reflow(struct grid *dst, const struct grid *src, u_int sx)
+{
+	u_int			 px, py, line, cell;
+	int			 previous_wrapped;
+	struct grid_line	*gl;
+
+	px = py = 0;
+	previous_wrapped = 1;
+	for (line = 0; line < src->sy + src->hsize; line++) {
+		gl = src->linedata + line;
+		if (!previous_wrapped) {
+			px = 0;
+			py++;
+			if (py >= dst->hsize + dst->sy)
+				grid_scroll_history(dst);
+		}
+		for (cell = 0; cell < gl->cellsize; cell++) {
+			if (px == sx) {
+				dst->linedata[py].flags |= GRID_LINE_WRAPPED;
+				px = 0;
+				py++;
+				if (py >= dst->hsize + dst->sy)
+					grid_scroll_history(dst);
+			}
+			grid_set_cell(dst, px, py, gl->celldata + cell);
+			px++;
+		}
+		previous_wrapped = gl->flags & GRID_LINE_WRAPPED;
+	}
+	py++; /* account for final line, which never wraps */
+
+	if (py > src->sy)
+		return (0);
+	return (src->sy - py);
+}
diff --git a/screen.c b/screen.c
index 6471372..f750f7f 100644
--- a/screen.c
+++ b/screen.c
@@ -141,6 +141,9 @@ screen_resize(struct screen *s, u_int sx, u_int sy)
 
 	if (sy != screen_size_y(s))
 		screen_resize_y(s, sy);
+	
+	/* TODO: Don't do this when in alternate screen. */
+	screen_reflow(s, sx);
 }
 
 void
@@ -357,3 +360,16 @@ screen_check_selection(struct screen *s, u_int px, u_int py)
 
 	return (1);
 }
+
+void
+screen_reflow(struct screen *s, u_int sx) {
+	struct grid	*old, *new;
+
+	old = s->grid;
+	new = grid_create(old->sx, old->sy, old->hlimit);
+
+	s->cy -= grid_reflow(new, old, sx);
+	s->grid = new;
+
+	grid_destroy(old);
+}
diff --git a/tmux.h b/tmux.h
index 04b3279..5ff625f 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1960,6 +1960,7 @@ void	 grid_move_cells(struct grid *, u_int, u_int, u_int, u_int);
 char	*grid_string_cells(struct grid *, u_int, u_int, u_int);
 void	 grid_duplicate_lines(
 	     struct grid *, u_int, struct grid *, u_int, u_int);
+u_int	 grid_reflow(struct grid *, const struct grid *, u_int);
 
 /* grid-cell.c */
 u_int	 grid_cell_width(const struct grid_cell *);
@@ -2058,6 +2059,7 @@ void	 screen_set_selection(struct screen *,
 	     u_int, u_int, u_int, u_int, u_int, struct grid_cell *);
 void	 screen_clear_selection(struct screen *);
 int	 screen_check_selection(struct screen *, u_int, u_int);
+void	 screen_reflow(struct screen *, u_int);
 
 /* window.c */
 extern struct windows windows;
