Index: src/keymap.c
===================================================================
--- src/keymap.c	(revision 1887)
+++ src/keymap.c	(working copy)
@@ -1120,6 +1120,7 @@
 							  hp_mode,
 							  legacy_mode,
 							  vt220_mode,
+							  cursor_mode & cursor_app,
 							  normal,
 							  normal_length);
 			_VTE_DEBUG_IF(VTE_DEBUG_KEYBOARD) {
@@ -1323,6 +1324,31 @@
 	return fkey;
 }
 
+/* Prior and Next are ommitted for the SS3 to CSI switch below */
+gboolean
+is_cursor_key(guint keyval)
+{
+	switch (keyval) {
+	case GDK_Home:
+	case GDK_Left:
+	case GDK_Up:
+	case GDK_Right:
+	case GDK_Down:
+	case GDK_End:
+
+	case GDK_KP_Home:
+	case GDK_KP_Left:
+	case GDK_KP_Up:
+	case GDK_KP_Right:
+	case GDK_KP_Down:
+	case GDK_KP_End:
+		return TRUE;
+	default:
+		return FALSE;
+	}
+}
+
+
 void
 _vte_keymap_key_add_key_modifiers(guint keyval,
 				  GdkModifierType modifiers,
@@ -1330,6 +1356,7 @@
 				  gboolean hp_mode,
 				  gboolean legacy_mode,
 				  gboolean vt220_mode,
+				  gboolean cursor_app_mode,
 				  char **normal,
 				  gssize *normal_length)
 {
@@ -1386,6 +1413,15 @@
 	nnormal = g_malloc0(*normal_length + 4);
 	memcpy(nnormal, *normal, *normal_length);
 	if (strlen(nnormal) > 1) {
+		/* SS3 should have no modifiers so make it CSI instead. See
+		 * http://cvsweb.xfree86.org/cvsweb/xc/programs/xterm/input.c.diff?r1=3.57&r2=3.58
+		 */
+		if (cursor_app_mode &&
+			g_str_has_prefix(nnormal, _VTE_CAP_SS3)
+			&& is_cursor_key(keyval)) {
+			nnormal[1] = '[';
+		}
+
 		/* Get the offset of the last character. */
 		offset = strlen(nnormal) - 1;
 		if (g_ascii_isdigit(nnormal[offset - 1])) {
Index: src/keymap.h
===================================================================
--- src/keymap.h	(revision 1887)
+++ src/keymap.h	(working copy)
@@ -56,6 +56,7 @@
 				       gboolean hp_mode,
 				       gboolean legacy_mode,
 				       gboolean vt220_mode,
+				       gboolean app_cursor_keys,
 				       char **normal,
 				       gssize *normal_length);
 
Index: src/vte.c
===================================================================
--- src/vte.c	(revision 1887)
+++ src/vte.c	(working copy)
@@ -4414,6 +4414,7 @@
 							  terminal->pvt->hp_fkey_mode,
 							  terminal->pvt->legacy_fkey_mode,
 							  terminal->pvt->vt220_fkey_mode,
+							  terminal->pvt->cursor_mode == VTE_KEYMODE_APPLICATION,
 							  &normal,
 							  &normal_length);
 			output = g_strdup_printf(normal, 1);
