Permalink
Browse files

zsh/sm console

  • Loading branch information...
mpapis committed Sep 25, 2011
1 parent 13135c5 commit 70d1bc3ffb967418db3c018a3f77b15feba0a847
Showing with 23 additions and 29 deletions.
  1. +1 −0 .gitignore
  2. +4 −18 core/cli/bin/console
  3. +1 −0 core/cli/zdotdir/.zshenv
  4. +17 −0 core/cli/zdotdir/.zshrc
  5. +0 −11 core/sm/shell/core/initialize
View
@@ -1,3 +1,4 @@
+core/cli/zdotdir/.zcompdump
releases/
release
site/
View
@@ -1,20 +1,6 @@
#!/bin/sh
-shell_version=( $( ${user_shell} --version | head -n 1 ) )
-
-[[ "${shell_version[1]}" == "bash," ]] && (( ${BASH_VERSINFO[0]} > 3 )) ||
- __sm.log.error "console: Unsuported shell:\n ${shell_version[*]}\n\nUse bash 4 for console\n"
-
-trap - ERR
-${user_shell} --rcfile <(echo "
- [[ -s ~/.bash_profile ]] && source ~/.bash_profile
- [[ -s ~/.profile ]] && source ~/.profile
- source ${sm_path}/core/sm/shell/core/initialize
- __sm.includes include api/vcs
- fail() { backtrace \"\$*\" no_exit ; }
- error() { printf \"\\nERROR: \$*\\n\" >&2 ; }
- exit() { builtin exit 0 ; }
- trap \"backtrace \\\"A command has returned __sm.log.error code (\\\$?) without being handled.\\\" no_exit\" ERR
- export PS1='(sm) [ret=\$?] \w > '
-") -i
-
+trap - ZERR
+typeset -x ZDOTDIR
+ZDOTDIR=${extension_path}/../cli/zdotdir
+zsh -i
View
@@ -0,0 +1 @@
+[[ -s ~/.zshenv ]] && source ~/.zshenv || true
View
@@ -0,0 +1,17 @@
+[[ -s ~/.zshrc ]] && source ~/.zshrc || true
+
+source ${sm_path}/core/sm/shell/core/initialize
+__sm.includes include api/vcs
+
+fail() { backtrace "$*" no_exit ; return 0 ; }
+error() { printf "\nERROR: $*\n" >&2 ; return 0 ; }
+exit() { builtin exit 0 ; }
+
+TRAPZERR()
+{
+ backtrace "A command has returned error code ($?) without being handled." no_exit
+ return 0
+}
+
+typeset -gx PS1
+PS1='(sm) [ret=%?] %d > '
@@ -69,17 +69,6 @@ else
fi
export __sm_array_start
-user_shell=$(which $(ps -eo pid,comm | awk "{ if ($PPID == \$1) print \$2}") 2>/dev/null ) || true
-
-case "${user_shell}" in
- *sh)
- true # all good!
- ;;
- *)
- user_shell=$(which $(ps -eo pid,comm | awk "{ if ($$ == \$1) print \$2}") 2>/dev/null ) || user_shell=bash
- ;;
-esac
-
if [[ -z "${sets_user_path}" ]]
then
if [[ -w "${sets_system_path}" ]] || (( UID == 0 ))

0 comments on commit 70d1bc3

Please sign in to comment.