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 103487 - gnome-terminal -x doesn't work, adds extra parameters
gnome-terminal -x doesn't work, adds extra parameters
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
2.1.x
Other other
: Normal normal
: ---
Assigned To: Havoc Pennington
GNOME Terminal Maintainers
: 104001 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-01-14 16:59 UTC by Tommi Komulainen
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Crude fix: ignore-display argument to option_parsing_results_init() (1.58 KB, patch)
2003-01-17 08:59 UTC, Devin Carraway
none Details | Review
fix (6.46 KB, patch)
2003-01-17 16:46 UTC, Havoc Pennington
none Details | Review

Description Tommi Komulainen 2003-01-14 16:59:15 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.
Comment 1 Havoc Pennington 2003-01-14 17:41:41 UTC
Also on redhat.com as
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81060
Comment 2 Christian Marillat 2003-01-15 20:38:02 UTC
And Debian too :)

http://bugs.debian.org/176901
Comment 3 Devin Carraway 2003-01-17 08:59:34 UTC
Created attachment 13643 [details] [review]
Crude fix: ignore-display argument to option_parsing_results_init()
Comment 4 Devin Carraway 2003-01-17 09:15:13 UTC
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?
Comment 5 Havoc Pennington 2003-01-17 15:30:50 UTC
I already have a patch here, sorry for not attaching.
Comment 6 Havoc Pennington 2003-01-17 15:31:56 UTC
(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. ;-)
Comment 7 Havoc Pennington 2003-01-17 16:46:29 UTC
Created attachment 13653 [details] [review]
fix
Comment 8 Havoc Pennington 2003-01-17 20:20:27 UTC
Patch in CVS now.
Comment 9 Havoc Pennington 2003-01-20 20:49:37 UTC
*** Bug 104001 has been marked as a duplicate of this bug. ***