diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index cbfe556..d74f8e6 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -2441,6 +2441,7 @@
   int i, j;
   char **term_argv = NULL;
   int term_argc = 0;
+  char *uterm;
   char *check;
   char **the_argv;
 
@@ -2474,6 +2475,12 @@
     }
   else
     {
+      if (check == NULL && ((uterm = g_environ_getenv("TERMINAL")) != NULL))
+      	check = g_find_program_in_path (uterm);
+      if (check == NULL && (uterm = g_environ_getenv("COLORTERM")) != NULL)
+      	check = g_find_program_in_path (uterm);
+      if (check == NULL && uterm != NULL)
+      	check = g_find_program_in_path (uterm);
       if (check == NULL)
         check = g_find_program_in_path ("nxterm");
       if (check == NULL)

