Index: src/vte.c
===================================================================
--- src/vte.c	(revision 1775)
+++ src/vte.c	(working copy)
@@ -7381,7 +7381,8 @@
 		/* Ensure the cursor is valid */
 		screen->cursor_current.row = CLAMP (screen->cursor_current.row,
 				_vte_ring_delta (screen->row_data),
-				_vte_ring_next (screen->row_data) - 1);
+				MAX (_vte_ring_delta (screen->row_data),
+					_vte_ring_next (screen->row_data) - 1));
 		/* Notify viewers that the contents have changed. */
 		_vte_terminal_queue_contents_changed(terminal);
 	}
