After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 336542 - gnome-terminal as preferred terminal breaks 'run in terminal' launchers
gnome-terminal as preferred terminal breaks 'run in terminal' launchers
Status: RESOLVED FIXED
Product: libgnome
Classification: Deprecated
Component: general
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: libgnome maintainer
libgnome maintainer
Depends on:
Blocks: 336700
 
 
Reported: 2006-03-29 20:58 UTC by Sebastien Bacher
Modified: 2006-04-04 09:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Should fix the bug (1.30 KB, patch)
2006-03-31 06:46 UTC, Vincent Untz
none Details | Review

Description Sebastien Bacher 2006-03-29 20:58:17 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/control-center/+bug/36171

"Selecting gnome-termianl as my preferred terminal sets the command to:

  gnome-terminal --working-directory=%f

I then create a launcher with the Command:

  ssh example.com

and check 'run in terminal'

Attempting to launch the launcher gives:

  Could not launch menu item

  Details: Failed to execute child process "gnome-terminal --working-directory=%f" (No such file or directory)

It would seem that the --working-directory argument is unnecessary as everything seems to work fine when I choose another terminal (or a gnome-terminal as a custom command without that argument).



Actually, it seems the launchers don't execute the specified command right in the preferred applications settings.

If I create a custom command for the terminal:

gnome-terminal --geometry=80x40

Then the nautilus terminal extension works fine and obeys the extra argument, but the launcher with 'run in terminal' selected seems to try to execute the whole command (via execve or whatever method is called) as a single command, as opposed to a command with arguments.

I get the expected error:

  Could not launch menu item

  Details: Failed to execute child process "gnome-terminal --geometry=80x40" (No such file or directory)

(should I file in gnome bugzilla or will malone handle the details?)"
Comment 1 Vincent Untz 2006-03-31 06:34:25 UTC
That's a libgnome bug: in gnome_prepend_terminal_to_vector(), we do:

	terminal = gconf_client_get_string (client, "/desktop/gnome/applications/terminal/exec", NULL);
	
	if (terminal) {
		gchar *exec_flag;
		exec_flag = gconf_client_get_string (client, "/desktop/gnome/applications/terminal/exec_arg", NULL);

		if (exec_flag == NULL) {
			term_argc = 1;
			term_argv = g_new0 (char *, 2);
			term_argv[0] = terminal;
			term_argv[1] = NULL;
		} else {
			term_argc = 2;
			term_argv = g_new0 (char *, 3);
			term_argv[0] = terminal;
			term_argv[1] = exec_flag;
			term_argv[2] = NULL;
		}
#if 0
	    poptParseArgvString (terminal, &term_argc, &temp_argv);
	    term_argv = g_strdupv ((gchar **) temp_argv);
	    g_free (terminal);
#endif
	}

It should check that terminal doesn't contain any parameter.
That's also a control-center bug since it shouldn't add any parameter to the exec gconf key ;-)
Comment 2 Vincent Untz 2006-03-31 06:35:26 UTC
Forgot to reassign.
Comment 3 Vincent Untz 2006-03-31 06:46:07 UTC
Created attachment 62439 [details] [review]
Should fix the bug

Didn't have time to test the patch, but it should work.
Comment 4 Sebastien Bacher 2006-04-04 08:34:09 UTC
patch works fine on my box
Comment 5 Kjartan Maraas 2006-04-04 09:13:50 UTC
Commited.