Selaa lähdekoodia

another attempt at an improved MSys dos prompt (merge from devbr6)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40693 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 15 vuotta sitten
vanhempi
commit
08120982f3
4 muutettua tiedostoa jossa 13 lisäystä ja 9 poistoa
  1. 9 5
      lib/init/functions.sh
  2. 2 2
      lib/init/grass.py
  3. 2 0
      lib/init/init.bat
  4. 0 2
      mswindows/GRASS-Installer.nsi

+ 9 - 5
lib/init/functions.sh

@@ -745,15 +745,19 @@ bash_startup()
 
 default_startup()
 {
-    PS1="GRASS $GRASS_VERSION ($LOCATION_NAME):\w > "
-    export PS1
-
     if [ "$MINGW" ] ; then
+	GRASS_MAJOR_VERSION=`echo "$GRASS_VERSION" | cut -f1 -d.`
+	PS1="GRASS $GRASS_MAJOR_VERSION> "
+	export PS1
+
 	# "$ETC/run" doesn't work at all???
-        "$SHELL"
+	"$SHELL"
 	rm -rf "$LOCATION/.tmp"/*  # remove GUI session files from .tmp
     else
-    	"$ETC/run" "$SHELL"
+	PS1="GRASS $GRASS_VERSION ($LOCATION_NAME):\w > "
+	export PS1
+
+	"$ETC/run" "$SHELL"
 	EXIT_VAL=$?
     fi
 }

+ 2 - 2
lib/init/grass.py

@@ -730,13 +730,13 @@ def bash_startup():
 def default_startup():
     global exit_val
 
-    os.environ['PS1'] = "GRASS %s (%s):\w > " % (grass_version, location_name)
-
     if windows:
+	os.environ['PS1'] = "GRASS %s> " % (grass_version, location_name)
 	# "$ETC/run" doesn't work at all???
 	exit_val = call([os.getenv('SHELL')])
 	cleanup_dir(os.path.join(location, ".tmp"))  # remove GUI session files from .tmp
     else:
+	os.environ['PS1'] = "GRASS %s (%s):\w > " % (grass_version, location_name)
 	exit_val = call([gfile("etc", "run"), os.getenv('SHELL')])
 
 def done_message():

+ 2 - 0
lib/init/init.bat

@@ -45,9 +45,11 @@ FOR /F "usebackq delims==" %%i IN (`"%WINGISBASE%\etc\winlocale"`) DO @set LANG=
 set GRASS_PAGER=more
 if "%GRASS_WISH%"=="" set GRASS_WISH=wish.exe
 if "%GRASS_SH%"=="" set GRASS_SH=c:\msys\1.0\bin\sh.exe
+
 rem Should do something with "assoc .html" and ftype here but would require
 rem a new g.manual.bat too so leaving it like this for now...
 if "%GRASS_HTML_BROWSER%"=="" set GRASS_HTML_BROWSER=%SYSTEMDRIVE%/PROGRA~1/INTERN~1/IEXPLORE.EXE
+
 if "%GRASS_PROJSHARE%"=="" set GRASS_PROJSHARE=CONFIG_PROJSHARE
 
 rem Add python scripts to the PATHEXT variable

+ 0 - 2
mswindows/GRASS-Installer.nsi

@@ -647,8 +647,6 @@ Section "GRASS" SecGRASS
 	FileWrite $0 'GRASS_PROJSHARE="$INSTALL_DIR\proj"$\r$\n'
 	FileWrite $0 'export GRASS_PROJSHARE$\r$\n'
 	FileWrite $0 '$\r$\n'
-	FileWrite $0 'export PS1="GRASS 7> "$\r$\n'
-	FileWrite $0 '$\r$\n'
 	FileWrite $0 'exec "$$GISBASE/etc/Init.sh" "$$@"'
 	FileClose $0
 	done_create_grass_command: