diff --git a/src/plugin/term/keyb_slang.c b/src/plugin/term/keyb_slang.c
index abf9b37ce..2c494a16a 100644
--- a/src/plugin/term/keyb_slang.c
+++ b/src/plugin/term/keyb_slang.c
@@ -652,6 +652,7 @@ static int init_slang_keymaps(void)
 {
 	SLKeyMap_List_Type *m;
 	char buf[5];
+	unsigned long esc_scan;
 	char * term;
 	char * kf21;
 
@@ -666,6 +667,10 @@ static int init_slang_keymaps(void)
 		config.term_esc_char = 30;
 	}
 
+	/* escape characters are identity mapped in unicode. */
+	esc_scan = config.term_esc_char;
+	esc_scan |= CTRL_MASK;
+
 	keyb_state.Esc_Char = config.term_esc_char + '@';
 
 	if (keyb_state.The_Normal_KeyMap != NULL)
@@ -756,7 +761,12 @@ static int init_slang_keymaps(void)
 	 * Now add one more for the esc character so that sending it twice sends
 	 * it.
 	 */
-	SLkm_define_key("^[^[", (VOID *) DKY_ESC, m);
+	buf[0] = '^';
+	buf[1] = keyb_state.Esc_Char;
+	buf[2] = '^';
+	buf[3] = keyb_state.Esc_Char;
+	buf[4] = 0;
+	SLkm_define_key("^[^[", (VOID *) esc_scan, m);
 	if (slang_get_error())
 		return -1;
 
