[GRASS-SVN] r30873 - grass/branches/releasebranch_6_3/lib/init
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Apr 5 20:41:52 EDT 2008
Author: hamish
Date: 2008-04-05 20:41:51 -0400 (Sat, 05 Apr 2008)
New Revision: 30873
Modified:
grass/branches/releasebranch_6_3/lib/init/grass-xterm-wrapper
Log:
backport from HEAD: try for alternatives if xterm isn't there (trac bug #117)
Modified: grass/branches/releasebranch_6_3/lib/init/grass-xterm-wrapper
===================================================================
--- grass/branches/releasebranch_6_3/lib/init/grass-xterm-wrapper 2008-04-05 23:46:35 UTC (rev 30872)
+++ grass/branches/releasebranch_6_3/lib/init/grass-xterm-wrapper 2008-04-06 00:41:51 UTC (rev 30873)
@@ -2,7 +2,19 @@
# script to wrap xterm
if [ -z "$GRASS_XTERM" ] ; then
- GRASS_XTERM=xterm
+ # find a working xterm or xterm compatible executable
+ TERM_TRY="xterm rxvt x-terminal-emulator"
+ for TERM_PROG in $TERM_TRY ; do
+ if [ -x "`which $TERM_PROG`" ] ; then
+ GRASS_XTERM="$TERM_PROG"
+ break
+ fi
+ done
+ if [ -z "$GRASS_XTERM" ] ; then
+ # no luck, use a default
+ g.message -w "No terminal program found, trying xterm"
+ GRASS_XTERM=xterm
+ fi
fi
# run command
More information about the grass-commit
mailing list