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,6 +2518,14 @@ prepend_terminal_to_vector (int *argc,
term_argv = g_new0 (char *, 3);
check = g_find_program_in_path ("gnome-terminal");
if (check != NULL)
{
term_argv[0] = check;
/* 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 ("mate-terminal");
if (check == NULL)
@ -2547,6 +2555,7 @@ prepend_terminal_to_vector (int *argc,
term_argv[0] = check;
term_argv[1] = g_strdup ("-e");
}
}
real_argc = term_argc + *argc;
real_argv = g_new (char *, real_argc + 1);