diff --git a/src/vte.cc b/src/vte.cc
index 353d7703..91e26c13 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -2947,6 +2947,7 @@ VteTerminalPrivate::insert_char(gunichar c,
 	long col;
 	int columns, i;
 	bool line_wrapped = false; /* cursor moved before char inserted */
+        gunichar c_unmapped = c;
 
         /* DEC Special Character and Line Drawing Set.  VT100 and higher (per XTerm docs). */
         static gunichar line_drawing_map[31] = {
@@ -3093,6 +3094,8 @@ VteTerminalPrivate::insert_char(gunichar c,
 				      row_num, 1);
 
 		goto done;
+        } else {
+                m_last_graphic_character = c_unmapped;
 	}
 
 	/* Make sure we have enough rows to hold this data. */
@@ -3635,6 +3638,7 @@ skip_chunk:
 			/* Call the right sequence handler for the requested
 			 * behavior. */
 			handle_sequence(seq_match, params);
+                        m_last_graphic_character = 0;
 
 			/* Skip over the proper number of unicode chars. */
 			start = (next - wbuf);
@@ -8047,6 +8051,7 @@ VteTerminalPrivate::VteTerminalPrivate(VteTerminal *t) :
 	m_conv_buffer = _vte_byte_array_new();
 	set_encoding(nullptr /* UTF-8 */);
 	g_assert_cmpstr(m_encoding, ==, "UTF-8");
+        m_last_graphic_character = 0;
 
         /* Set up the emulation. */
 	m_keypad_mode = VTE_KEYMODE_NORMAL;
@@ -10287,6 +10292,7 @@ VteTerminalPrivate::reset(bool clear_tabstops,
         m_iso2022 = _vte_iso2022_state_new(nullptr);
 	_vte_iso2022_state_set_codeset(m_iso2022,
 				       m_encoding);
+        m_last_graphic_character = 0;
 	/* Reset keypad/cursor key modes. */
 	m_keypad_mode = VTE_KEYMODE_NORMAL;
 	m_cursor_mode = VTE_KEYMODE_NORMAL;
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 037b5911..e96e3f26 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -315,6 +315,8 @@ public:
 	/* IConv buffer. */
         VteByteArray *m_conv_buffer;
 
+        gunichar m_last_graphic_character;
+
 	/* Screen data.  We support the normal screen, and an alternate
 	 * screen, which seems to be a DEC-specific feature. */
         struct _VteScreen m_normal_screen, m_alternate_screen, *m_screen;
diff --git a/src/vteseq-n.gperf b/src/vteseq-n.gperf
index eec89aee..7cd1de50 100644
--- a/src/vteseq-n.gperf
+++ b/src/vteseq-n.gperf
@@ -28,7 +28,7 @@ struct vteseq_n_struct {
 "tab", VTE_SEQUENCE_HANDLER(vte_sequence_handler_tab)
 "index", VTE_SEQUENCE_HANDLER(vte_sequence_handler_index)
 "decset", VTE_SEQUENCE_HANDLER(vte_sequence_handler_decset)
-#"repeat", VTE_SEQUENCE_HANDLER_NULL
+"repeat", VTE_SEQUENCE_HANDLER(vte_sequence_handler_repeat)
 "tab-set", VTE_SEQUENCE_HANDLER(vte_sequence_handler_tab_set)
 "decreset", VTE_SEQUENCE_HANDLER(vte_sequence_handler_decreset)
 "set-mode", VTE_SEQUENCE_HANDLER(vte_sequence_handler_set_mode)
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 1391e153..7f95c84c 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (C) 2001-2004 Red Hat, Inc.
  *
@@ -598,6 +597,14 @@ vte_set_focus_tracking_mode(VteTerminalPrivate *that,
         that->feed_focus_event_initial();
 }
 
+/* Repeat the last graphic character once. */
+static void
+vte_sequence_handler_repeat_internal (VteTerminalPrivate *that, GValueArray *params)
+{
+        if (that->m_last_graphic_character != 0)
+                that->insert_char (that->m_last_graphic_character, false, true);
+}
+
 struct decset_t {
         gint16 setting;
         /* offset in VteTerminalPrivate (> 0) or VteScreen (< 0) */
@@ -2661,6 +2668,16 @@ vte_sequence_handler_reset_mode (VteTerminalPrivate *that, GValueArray *params)
 	}
 }
 
+/* Repeat the last graphic character n times. */
+static void
+vte_sequence_handler_repeat (VteTerminalPrivate *that, GValueArray *params)
+{
+        vte_sequence_handler_multiple_limited (that,
+                                               params,
+                                               vte_sequence_handler_repeat_internal,
+                                               65535);
+}
+
 /* Set certain terminal attributes. */
 static void
 vte_sequence_handler_decset (VteTerminalPrivate *that, GValueArray *params)
