On Mon, May 2, 2011 at 5:31 PM, JD <jd1008(a)gmail.com> wrote:
On 05/02/11 14:09, Cameron Simpson wrote:
> On 02May2011 13:14, JD<jd1008(a)gmail.com> wrote:
> | $ cat /home/jd/bin/viewer
> | #!/bin/sh
> | xterm -fn 12x24 -bg white -fg black -e vi $*&
> |
> | How can I replace xterm with gnome-terminal?
> |
> | I tried to simply change xterm to gnome-terminal
> | but gnome-terminal does not recognize the args
> | and never executes vi on the file selected.
>
> I discovered to my horror several years ago that gnome-terminal wants to
> use "-x" where xterm and most other terminals use "-e".
>
> Have a look at "man gnome-terminal" for specifics.
>
> But try this:
>
> gnome-terminal -bg white -fg black -x vi ${1+"$@"}&
>
> ALso note the change of $* - your origial script will break if you get files
> with whitespec in their names.
When I tried it I got this message:
Failed to parse arguments: Unknown option -bg
Also, there is no man page for gnome-terminal on my F14.
You can set up a profile with white bg and black fg and then call it
with "--window-with-profile=PROFILENAME]" or
"--tab-with-profile=PROFILENAME".
For the command, from the 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.