GNOME Bugzilla – Bug 103487
gnome-terminal -x doesn't work, adds extra parameters
Last modified: 2004-12-22 21:47:04 UTC
Version: 2.1.4 The following script (call it /tmp/test.sh) demonstrates a bug in gnome-terminal -x: #!/bin/sh echo "@" read line "gnome-terminal -x /tmp/test.sh" displays "--display :0.0" and "gnome-terminal -x /tmp/test.sh foo" displays "foo --display :0.0" The added "--display :0.0" obviously breaks non-X apps that don't support the parameter. OTOH, "-e" or "--disable-factory -x" doesn't have this problem.
Also on redhat.com as https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81060
And Debian too :) http://bugs.debian.org/176901
Created attachment 13643 [details] [review] Crude fix: ignore-display argument to option_parsing_results_init()
The general problem seems to be that option_parsing_results_init() gets to snag the -x options out before option_parsing_results_check_for_display_name() can strip back out the --display put there before the factory was invoked. Stripping it after the fact doesn't help, because the argv has already been strdup()ed. This patch does not consider --startup-id, mostly because I didn't notice in time, and does not address the more general problems caused by slapping arguments on the end of a purportedly free-form string. Could the display/screen/etc be passed in as a distinct bonobo argument instead?
I already have a patch here, sorry for not attaching.
(well, I was going to attach now but the patch is at work.) Anyway, the basic solution is to insert --display/--startup-id at argv[1] not at the end, and then fix all the other bugs that exposes. ;-)
Created attachment 13653 [details] [review] fix
Patch in CVS now.
*** Bug 104001 has been marked as a duplicate of this bug. ***