GNOME Bugzilla – Bug 701691
-e accepts only one term; all other terminal emulators accept more than one term
Last modified: 2013-06-07 11:21:13 UTC
Hello From the gnome-terminal man page: -e, --command=STRING Execute the argument to this option inside the terminal. -x, --execute Execute the remainder of the command line inside the terminal. This behaviour is inconsistent with all other terminal emulators. This inconsistency creates problems. From the uberspace.de linked page: <blockquote> `xterm -e vim file' -- I get vim with the file open. `gnome-terminal -e vim file' -- I just get vim. To have vim open the file too I have to say: `gnome-terminal -e "vim file" '. </blockquote> This necessitates a workaround ['hut' on the uberspace.de]: <blockquote> #!/usr/bin/python # filename: /usr/bin/gnometerm from subprocess import Popen from sys import argv def shell_quote(string): return "'" + str(string).replace("'", "'\\''") + "'" Popen(["gnome-terminal", argv[1], (" ".join(shell_quote(arg) for arg in argv[2:]))]) </blockquote> Developers, please consider making the behaviour of -e consistent with other terminal emulators! In gnome-terminal since -e is just a subset of -x can you not just make -e a synonym of -x? There is this though: g-t allows other options after -e, so it may break existing scripts. Contrawise, wouldn't scripts use xterm, and not gnome-terminal? http://ranger.carina.uberspace.de/qa/33/gnome-terminal-cannot-set-termcmd-for-open_with-new-window --- From the man pages: xterm: -e program [ arguments ... ] This option specifies the program (and its command line arguments) to be run in the xterm window. This must be the last option on the command line. konsole: -e <command> [ arguments ] Execute ’command’ instead of shell. This must be the last option on the command line. roxterm: -e --execute Execute remainder of command line inside the terminal. Must be final option. http://manpages.ubuntu.com/manpages/raring/en/man1/xterm.1.html http://manpages.ubuntu.com/manpages/hardy/man1/konsole.1.html http://manpages.ubuntu.com/manpages/hardy/man1/roxterm.1.html
This works as designed. Note that both -x and -e are deprecated; the only supported way to pass the arguments is after -- like this: $ gnome-terminal -- emacs file
Thanks for the reply! This solution is the best, as changing the interface would have been horrible anyway. This (`--') way to pass the executable is not mentioned in my man page (v.3.4.1.1), even though it works in my version. Could you or someone please add this in the man page? Also, please mention that -x and -e are deprecated. Thanks.
The man page is a debian addition and doesn't exist upstream (bug 311565).
Ok, I will inform the Debian package maintainer. But, in that case, where is the documentation users are supposed to consult? Is there a page describing all this that the package manager can check to update the man page?
There are no docs for the gnome-terminal command line options.
Thanks for your replies. I have submitted a bug report with Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711508