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

Glynn Clements glynn at gclements.plus.com
Sun Aug 27 14:58:22 EDT 2006


Markus Neteler wrote:

> > > Debian folks are unhappy with the hardcoded 'xterm' in
> > > many places and suggest to replace it with a wrapper script so
> > > that they have to change it in a single place later.
> > > 
> > > They do:
> > > http://svn.debian.org/wsvn/pkg-grass/packages/grass/branches/6.1/debian/patches/xterm-fix.dpatch?op=file&rev=0&sc=0
> > > 
> > > Should we invent a 'grass-xterm' script (in $ETC?) for
> > > that? What would be the needed content (thinking portability)?
> > 
> > That's one option; another is an environment variable, GRASS_XTERM. If
> > a wrapper script is used, it should check $GRASS_XTERM before falling
> > back to x-terminal-emulator or xterm.
> 
> Based on above diff I have prepared a wrapper script and a patch:
> 
> http://mpa.itc.it/markus/xterm_wrapper/
> 
> I am not sure if and where the 'exec's are needed (see patch)

I suggest ending the script with:

	# run command
	exec $GRASS_XTERM "$@"

The lines which are executed after xterm completes aren't meaningful
unless you're running from a terminal, which won't be the case in any
situation where the script is actually used (the only reason for
spawning an xterm is if you don't already have a terminal, i.e. when
running commands from d.m/gis.m).

The wrapper should probably go into $GISBASE/etc, in which case the
patch needs to use $GISBASE/etc/grass-xterm-wrapper (or
$env(GISBASE)/etc/grass-xterm-wrapper for Tcl code) rather than just
grass-xterm-wrapper.

Also, Init.sh should probably set GRASS_XTERM to x-terminal-emulator
if it is available. IIRC, x-terminal-emulator runs the user's
preferred terminal emulator (xterm, kterm etc), so it should always be
preferred over xterm if it's available.

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




More information about the grass-dev mailing list