diff --git a/src/vte.c b/src/vte.c
index 3ffd572..bfc0682 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -8618,6 +8618,11 @@ vte_terminal_init(VteTerminal *terminal)
 	pvt->screen = &terminal->pvt->normal_screen;
 	_vte_terminal_set_default_attributes(terminal);
 
+	/* Set up the desired palette. */
+	if (!terminal->pvt->palette_initialized) {
+		vte_terminal_set_default_colors(terminal);
+	}
+
 	/* Set up I/O encodings. */
 	pvt->iso2022 = _vte_iso2022_state_new(pvt->encoding,
 					      &_vte_terminal_codeset_changed_cb,
@@ -9295,11 +9300,6 @@ vte_terminal_realize(GtkWidget *widget)
 	/* Set the realized flag. */
 	gtk_widget_set_realized (widget, TRUE);
 
-	/* Set up the desired palette. */
-	if (!terminal->pvt->palette_initialized) {
-		vte_terminal_set_default_colors(terminal);
-	}
-
 	/* Set up input method support.  FIXME: do we need to handle the
 	 * "retrieve-surrounding" and "delete-surrounding" events? */
 	if (terminal->pvt->im_context != NULL) {
