--- src/empathy-chat-window.c.orig	2008-10-03 14:33:51.000000000 +0200
+++ src/empathy-chat-window.c	2008-10-03 14:32:15.000000000 +0200
@@ -133,6 +133,12 @@
 	if (num != -1) {
 		gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), num);
 	}
+
+	/* Close current tab when escape is pressed. */
+	if (key == GDK_Escape) {
+	        g_return_if_fail (priv->current_chat != NULL);
+		empathy_chat_window_remove_chat (window, priv->current_chat);
+	}
 }
 
 static EmpathyChatWindow *
@@ -1257,6 +1263,15 @@
 					 closure);
 	}
 
+	closure = g_cclosure_new (G_CALLBACK (chat_window_accel_cb),
+	                          window,
+	                          NULL);
+	gtk_accel_group_connect (accel_group,
+	                         GDK_Escape,
+	                         0,
+	                         0,
+	                         closure);
+
 	g_object_unref (accel_group);
 
 	/* Set up smiley menu */
