[GRASS-SVN] r30863 - grass/trunk/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Apr 4 21:13:34 EDT 2008


Author: hamish
Date: 2008-04-04 21:13:34 -0400 (Fri, 04 Apr 2008)
New Revision: 30863

Modified:
   grass/trunk/lib/init/grass-xterm-wrapper
Log:
if xterm isn't there, try another (add as needed). If none found issue a warning. (trac bug #117)

Modified: grass/trunk/lib/init/grass-xterm-wrapper
===================================================================
--- grass/trunk/lib/init/grass-xterm-wrapper	2008-04-04 23:28:41 UTC (rev 30862)
+++ grass/trunk/lib/init/grass-xterm-wrapper	2008-04-05 01:13:34 UTC (rev 30863)
@@ -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"
+   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