Merge 1.6.0 changes back to patch.
diff --git a/src/terminal/terminal-handlers.c b/src/terminal/terminal-handlers.c
index e5731b4..cbdf922 100644
--- a/src/terminal/terminal-handlers.c
+++ b/src/terminal/terminal-handlers.c
@@ -1071,6 +1071,13 @@
                         guac_terminal_scrollbar_set_bounds(term->scrollbar,
                                 -guac_terminal_get_available_scroll(term), 0);
 
+                        /* Redraw normal buffer content */
+                        guac_terminal_redraw_default_layer(term);
+                        
+                        /* Clear selection */
+                        term->text_selected = false;
+                        term->selection_committed = false;
+
                     }
 
                     /* Clear normal buffer only if we were previously using
diff --git a/src/terminal/terminal.c b/src/terminal/terminal.c
index fd7c719..7e52a4b 100644
--- a/src/terminal/terminal.c
+++ b/src/terminal/terminal.c
@@ -2121,10 +2121,7 @@
     display->default_background = default_char->attributes.background;
 
     /* Redraw terminal text and background */
-    guac_terminal_repaint_default_layer(terminal, client->socket);
-    __guac_terminal_redraw_rect(terminal, 0, 0,
-            terminal->term_height - 1,
-            terminal->term_width - 1);
+    guac_terminal_redraw_default_layer(terminal);
 
     /* Acquire exclusive access to terminal */
     guac_terminal_lock(terminal);
@@ -2147,7 +2144,6 @@
 void guac_terminal_apply_font(guac_terminal* terminal, const char* font_name,
         int font_size, int dpi) {
 
-    guac_client* client = terminal->client;
     guac_terminal_display* display = terminal->display;
 
     if (guac_terminal_display_set_font(display, font_name, font_size, dpi))
@@ -2159,10 +2155,7 @@
             terminal->outer_height);
 
     /* Redraw terminal text and background */
-    guac_terminal_repaint_default_layer(terminal, client->socket);
-    __guac_terminal_redraw_rect(terminal, 0, 0,
-            terminal->term_height - 1,
-            terminal->term_width - 1);
+    guac_terminal_redraw_default_layer(terminal);
 
     /* Acquire exclusive access to terminal */
     guac_terminal_lock(terminal);
@@ -2228,3 +2221,12 @@
     /* Remove the user from the terminal cursor */
     guac_common_cursor_remove_user(terminal->cursor, user);
 }
+
+void guac_terminal_redraw_default_layer(guac_terminal* terminal) {
+
+    /* Redraw terminal text and background */
+    guac_terminal_repaint_default_layer(terminal, terminal->client->socket);
+    __guac_terminal_redraw_rect(terminal, 0, 0,
+            terminal->term_height - 1,
+            terminal->term_width - 1);
+}
diff --git a/src/terminal/terminal/terminal-priv.h b/src/terminal/terminal/terminal-priv.h
index 19d7d8d..52462ce 100644
--- a/src/terminal/terminal/terminal-priv.h
+++ b/src/terminal/terminal/terminal-priv.h
@@ -682,4 +682,12 @@
  */
 void guac_terminal_flush(guac_terminal* terminal);
 
+/**
+ * Redraw default layer text and background.
+ *
+ * @param terminal
+ *      The terminal to redraw.
+ */
+void guac_terminal_redraw_default_layer(guac_terminal* terminal);
+
 #endif