[GRASS-dev] hardcoded 'xterm': wrapper?

>>> It seems to work for me,
>> After this change any command from d.m that spawns terminal (d.zoom,
>> r.digit etc.) is broken on my Ubuntu Dapper, where gnome-terminal is a
>> default terminal.
>>
>> In spearfish60:
>>
>> $ d.m
>> add any layer
>> display it
>> press Zoom
>>
>> gnome-terminal pops-up saying:
>>
>> ---
>> /usr/local/grass-6.3.cvs/etc/grass-run.sh: line 30: d.zoom: command not
>> found
>>
>> ERROR: d.zoom exited abnormally. Press <enter> to continue.
>> ---
>
> It appears that gnome-terminal resets $PATH.
>
> In which case, you need to either set GRASS_XTERM to "xterm" to force
> the use of an xterm instead, or figure out how to make gnome-terminal
> preserve $PATH.

gnome-terminal is a default terminal for Gnome as you know. That means
that not only I, but most Gnome would have to do it. This means that
d.m in Grass 6.3 will be broken on many Linux boxes by default. If we
don't want it, shouldn't the change that breaks Grass 6.3 on Gnome
should be reverted?

What was wrong about using xterm by deafult?

Programs which require a terminal should arguably use the user's
preferred terminal by default. Of course, that reasoning falls down if
the user's preferred terminal is signficantly broken.

Have you checked whether this is an actual gnome-terminal
bug/misfeature, or whether it's just your configuration that's causing
problems?

--
Glynn Clements <glynn@gclements.plus.com>

Glynn Clements wrote:

It seems to work for me,

After this change any command from d.m that spawns terminal (d.zoom,
r.digit etc.) is broken on my Ubuntu Dapper, where gnome-terminal is a
default terminal.

In spearfish60:

$ d.m
add any layer
display it
press Zoom

gnome-terminal pops-up saying:

---
/usr/local/grass-6.3.cvs/etc/grass-run.sh: line 30: d.zoom: command not
found

ERROR: d.zoom exited abnormally. Press <enter> to continue.
---

It appears that gnome-terminal resets $PATH.

In which case, you need to either set GRASS_XTERM to "xterm" to force
the use of an xterm instead, or figure out how to make gnome-terminal
preserve $PATH.

gnome-terminal is a default terminal for Gnome as you know. That means
that not only I, but most Gnome would have to do it. This means that
d.m in Grass 6.3 will be broken on many Linux boxes by default. If we
don't want it, shouldn't the change that breaks Grass 6.3 on Gnome
should be reverted?

What was wrong about using xterm by deafult?

Programs which require a terminal should arguably use the user's
preferred terminal by default. Of course, that reasoning falls down if
the user's preferred terminal is signficantly broken.

Have you checked whether this is an actual gnome-terminal
bug/misfeature, or whether it's just your configuration that's causing
problems?

I can confirm the problem, and up to now, I have not been able to find a command switch to gnome-terminal which allows to keep environment variables...

Moritz

Moritz Lennert wrote:

>>>> After this change any command from d.m that spawns terminal (d.zoom,
>>>> r.digit etc.) is broken on my Ubuntu Dapper, where gnome-terminal is a
>>>> default terminal.
>>>>
>>>> In spearfish60:
>>>>
>>>> $ d.m
>>>> add any layer
>>>> display it
>>>> press Zoom
>>>>
>>>> gnome-terminal pops-up saying:
>>>>
>>>> ---
>>>> /usr/local/grass-6.3.cvs/etc/grass-run.sh: line 30: d.zoom: command not
>>>> found
>>>>
>>>> ERROR: d.zoom exited abnormally. Press <enter> to continue.
>>>> ---
>>> It appears that gnome-terminal resets $PATH.
>>>
>>> In which case, you need to either set GRASS_XTERM to "xterm" to force
>>> the use of an xterm instead, or figure out how to make gnome-terminal
>>> preserve $PATH.
>> gnome-terminal is a default terminal for Gnome as you know. That means
>> that not only I, but most Gnome would have to do it. This means that
>> d.m in Grass 6.3 will be broken on many Linux boxes by default. If we
>> don't want it, shouldn't the change that breaks Grass 6.3 on Gnome
>> should be reverted?
>>
>> What was wrong about using xterm by deafult?
>
> Programs which require a terminal should arguably use the user's
> preferred terminal by default. Of course, that reasoning falls down if
> the user's preferred terminal is signficantly broken.
>
> Have you checked whether this is an actual gnome-terminal
> bug/misfeature, or whether it's just your configuration that's causing
> problems?

I can confirm the problem, and up to now, I have not been able to find a
command switch to gnome-terminal which allows to keep environment
variables...

In which case, grass-xterm-wrapper should simply set GRASS_XTERM to
"xterm" if it isn't already set, and not attempt to use
x-terminal-emulator.

If the user wants to use x-terminal-emulator, they'll need to set
GRASS_XTERM themselves, and ensure that their chosen program works.

GRASS uses environment variables extensively; a terminal emulator
which clears the environment is essentially detaching itself from the
GRASS session.

--
Glynn Clements <glynn@gclements.plus.com>

On Thu, Aug 31, 2006 at 02:17:34PM +0100, Glynn Clements wrote:

> variables...

In which case, grass-xterm-wrapper should simply set GRASS_XTERM to
"xterm" if it isn't already set, and not attempt to use
x-terminal-emulator.

If the user wants to use x-terminal-emulator, they'll need to set
GRASS_XTERM themselves, and ensure that their chosen program works.

GRASS uses environment variables extensively; a terminal emulator
which clears the environment is essentially detaching itself from the
GRASS session.

OK, I have simplified this now to:

################ snip ##############

#!/bin/sh
# script to wrap xterm

if [ -z "$GRASS_XTERM" ] ; then
   GRASS_XTERM=xterm
fi

# run command
exec $GRASS_XTERM "$@"

########## snap ####################

Markus