Ticket #11866: trac11866_proper_zsh_prompt.patch

File trac11866_proper_zsh_prompt.patch, 951 bytes (added by Martin Albrecht, 11 years ago)
  • sage-sage

    # HG changeset patch
    # User Martin Albrecht <martinralbrecht@googlemail.com>
    # Date 1317239703 -3600
    # Node ID de54635fc0cec1435d975993e5a8df58792cb350
    # Parent  c280be227adf119732629c4be2e8d8744bdbf812
    #11866 Sage should set PS1 correctly for zsh
    
    diff --git a/sage-sage b/sage-sage
    a b  
    480480    # We must start a new shell with no .profile or .bashrc files
    481481    # processed, so that we know our path is correct
    482482    PS1="SAGE_ROOT=${SAGE_ROOT}\n(sage subshell) \h:\W \u\$ "
    483     export PS1
    484483    case $SHELL_NAME in
    485484        bash)
    486485            SHELL_OPTS=" --norc"
     
    498497            SHELL_OPTS=" -f"
    499498            ;;
    500499        zsh)
     500PS1="SAGE_ROOT=${SAGE_ROOT}
     501(sage subshell) %m:%~ %n$ "
    501502            SHELL_OPTS=" -f -d"
    502503            ;;
    503504        *)
     
    505506            echo >&2 "Exiting Sage."
    506507            exit 1
    507508    esac
     509    export PS1
    508510
    509511    $SHELL_NAME $SHELL_OPTS "$@"
    510512