Minh suggests that developers would prefer to have
the current directory listed in a sage sub-shell prompt.
The patch below causes the current directory to be
listed on one line and then "sage subshell$ " on the
next. Hopefully this will help people like Paulo
remember when they are in a sage subshell.
# ./sage -sh
Starting subshell with Sage environment variables set.
Be sure to exit when you are done and do not do anything
with other copies of Sage!
Bypassing shell configuration files ...
/home/mariah/sage/sage-4.1.1-x86_64-Linux-core2-fc
sage subshell$ echo hi
hi
/home/mariah/sage/sage-4.1.1-x86_64-Linux-core2-fc
sage subshell$
If this is acceptable, would a kind developer check
this in.
Mariah
--- sage-sage.old 2009-09-25 10:52:08.278703000 -0400
+++ sage-sage 2009-09-28 09:59:12.151547000 -0400
@@ -374,41 +374,37 @@
echo "with other copies of Sage!"
echo ""
SHELL_NAME=`basename $SHELL`
- if [ $# -eq 0 ]; then
- SHELL_OPTS=""
- else
- shift
- echo "Bypassing shell configuration files ..."
- echo
- # We must start a new shell with no .profile or .bashrc files
- # processed, so that we know our path is correct
- PS1="sage$ "
- export PS1
- case $SHELL_NAME in
- bash)
- SHELL_OPTS=" --norc"
- ;;
- csh)
- SHELL_OPTS=" -f"
- ;;
- ksh)
- SHELL_OPTS=" -p"
- ;;
- sh)
- SHELL_OPTS=" --norc"
- ;;
- tcsh)
- SHELL_OPTS=" -f"
- ;;
- zsh)
- SHELL_OPTS=" -f -d"
- ;;
- *)
- echo "Unknown shell: $SHELL!"
- echo "Exiting Sage."
- exit 1
- esac
- fi
+
+ echo "Bypassing shell configuration files ..."
+ echo
+ # We must start a new shell with no .profile or .bashrc files
+ # processed, so that we know our path is correct
+ PS1="${PWD}\nsage subshell$ "
+ export PS1
+ case $SHELL_NAME in
+ bash)
+ SHELL_OPTS=" --norc"
+ ;;
+ csh)
+ SHELL_OPTS=" -f"
+ ;;
+ ksh)
+ SHELL_OPTS=" -p"
+ ;;
+ sh)
+ SHELL_OPTS=" --norc"
+ ;;
+ tcsh)
+ SHELL_OPTS=" -f"
+ ;;
+ zsh)
+ SHELL_OPTS=" -f -d"
+ ;;
+ *)
+ echo "Unknown shell: $SHELL!"
+ echo "Exiting Sage."
+ exit 1
+ esac
$SHELL_NAME $SHELL_OPTS "$@"
echo Exited Sage subshell.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---