Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

zsh/sm console

  • Loading branch information...
commit 70d1bc3ffb967418db3c018a3f77b15feba0a847 1 parent 13135c5
@mpapis mpapis authored
View
1  .gitignore
@@ -1,3 +1,4 @@
+core/cli/zdotdir/.zcompdump
releases/
release
site/
View
22 core/cli/bin/console
@@ -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
1  core/cli/zdotdir/.zshenv
@@ -0,0 +1 @@
+[[ -s ~/.zshenv ]] && source ~/.zshenv || true
View
17 core/cli/zdotdir/.zshrc
@@ -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 > '
View
11 core/sm/shell/core/initialize
@@ -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 ))
Please sign in to comment.
Something went wrong with that request. Please try again.