--- vte-0.28.2.orig/src/vtestream-file.h	2011-08-16 23:52:48.000000000 +0200
+++ vte-0.28.2/src/vtestream-file.h	2012-02-01 17:08:26.373000064 +0100
@@ -22,6 +22,10 @@
 #include <unistd.h>
 #include <errno.h>
 
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
 #include <gio/gunixinputstream.h>
 
 static gsize
@@ -147,18 +151,28 @@
 {
 	gint fd;
 	gchar *file_name;
+
+	gchar fn[]="/dev/shm/vteXXXXXX";
+
 	if (G_LIKELY (stream->fd[0]))
 		return;
 
-	fd = g_file_open_tmp ("vteXXXXXX", &file_name, NULL);
-	if (fd != -1) {
+	fd = g_mkstemp(fn);
+	if (fd == -1) {
+	    fd = g_file_open_tmp ("vteXXXXXX", &file_name, NULL);
+	    if (fd != -1) {
 		unlink (file_name);
 		g_free (file_name);
-	}
+	    }
+	    stream->fd[0] = dup (fd); /* we do the dup to make sure ->fd[0] is not 0 */
 
-	stream->fd[0] = dup (fd); /* we do the dup to make sure ->fd[0] is not 0 */
-
-	close (fd);
+	    close (fd);
+	}
+	else {
+	    unlink(fn);
+	    stream->fd[0] = dup(fd);
+	    close(fd);
+	}
 }
 
 static void
