The open trac tickets #4644 and #5507 discuss
problems with "sage -sh", specifically

#4644  - No new prompt when doing a ./sage -sh

#5507 - $ sage -sh -c "echo hi there"  # does not work, but should
              $ sage -sh -c -c "echo hi there" # works, but shouldn't

There is also a problem that "sage -sh" may pick up the user's
$PATH rather than the one defined in sage-env (which
is how I got into this issue).

The patch below fixes these three problems - but it may
not be what developers want.  Specifically, it will set the
prompt to be "sage $" for all shells (with the exception of
csh which does not have a prompt environment variable and
so the prompt gets set to "%").   Note that with the patch
the prompt is NOT listing the current directory.

Do developers prefer that a sage-sub-shell prompt list
the current directory?

If so, I will have another think about this.  If not, would
a kind person please check in the patch.

Mariah

--- sage-sage.old       2009-09-25 10:52:08.278703000 -0400
+++ sage-sage.new       2009-09-25 15:11:21.214214000 -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="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
     $SHELL_NAME $SHELL_OPTS "$@"

     echo Exited Sage subshell.

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to