gdesktopappinfo: Update calling convention for gnome-terminal

For several years now (I haven’t looked up the exact date),
`gnome-terminal` has preferred being called as `gnome-terminal
--terminal-args -- /some/other/program --its-args` rather than as
`gnome-terminal --terminal-args -x /some/other/program --its-args`.
Since 2017 it has warned about uses of `-x` (see
ad4edbd118).

So we should change our calling convention for it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2019-06-28 12:58:59 +01:00
parent d50caa8fb9
commit d55f6fb5fe

View File

@ -2518,34 +2518,43 @@ prepend_terminal_to_vector (int *argc,
term_argv = g_new0 (char *, 3);
check = g_find_program_in_path ("gnome-terminal");
if (check == NULL)
check = g_find_program_in_path ("mate-terminal");
if (check == NULL)
check = g_find_program_in_path ("xfce4-terminal");
if (check != NULL)
{
term_argv[0] = check;
/* Note that gnome-terminal takes -x and
* as -e in gnome-terminal is broken we use that. */
term_argv[1] = g_strdup ("-x");
/* Since 2017, gnome-terminal has preferred `--` over `-x` or `-e`. */
term_argv[1] = g_strdup ("--");
}
else
{
if (check == NULL)
check = g_find_program_in_path ("nxterm");
if (check == NULL)
check = g_find_program_in_path ("color-xterm");
if (check == NULL)
check = g_find_program_in_path ("rxvt");
if (check == NULL)
check = g_find_program_in_path ("dtterm");
check = g_find_program_in_path ("mate-terminal");
if (check == NULL)
check = g_find_program_in_path ("xfce4-terminal");
if (check != NULL)
{
check = g_strdup ("xterm");
g_debug ("Couldnt find a terminal: falling back to xterm");
term_argv[0] = check;
/* Note that gnome-terminal takes -x and
* as -e in gnome-terminal is broken we use that. */
term_argv[1] = g_strdup ("-x");
}
else
{
if (check == NULL)
check = g_find_program_in_path ("nxterm");
if (check == NULL)
check = g_find_program_in_path ("color-xterm");
if (check == NULL)
check = g_find_program_in_path ("rxvt");
if (check == NULL)
check = g_find_program_in_path ("dtterm");
if (check == NULL)
{
check = g_strdup ("xterm");
g_debug ("Couldnt find a terminal: falling back to xterm");
}
term_argv[0] = check;
term_argv[1] = g_strdup ("-e");
}
term_argv[0] = check;
term_argv[1] = g_strdup ("-e");
}
real_argc = term_argc + *argc;