File tree 3 files changed +12
-16
lines changed
3 files changed +12
-16
lines changed Original file line number Diff line number Diff line change 1
1
# geometry_exitcode - show the exit code of the last status
2
2
3
- (( $GEOMETRY[LAST_STATUS] )) && ansi ${GEOMETRY_EXITCODE_COLOR:-red} $GEOMETRY[LAST_STATUS] || echo ''
3
+ (( $GEOMETRY_STATUS )) && ansi ${GEOMETRY_EXITCODE_COLOR:-red} $GEOMETRY_STATUS
Original file line number Diff line number Diff line change 1
1
# geometry_status - show a symbol with error/success and root/non-root information
2
2
3
- local root; [[ $UID = 0 || $EUID = 0 ]] && root =true || root =false
4
- local error; (( $GEOMETRY[LAST_STATUS] )) && error =true || error =false
3
+ (( $GEOMETRY_STATUS )) && error =true || error =false
4
+ [[ $UID = 0 || $EUID = 0 ]] && root =true || root =false
5
5
6
- local color=${GEOMETRY_STATUS_COLOR:-default}
6
+ ( $error ) && color=${GEOMETRY_STATUS_COLOR_ERROR:-red} || color=${GEOMETRY_STATUS_COLOR:-default}
7
7
8
- if ( $ error );
9
- then
10
- color =${GEOMETRY_STATUS_COLOR_ERROR:-red};
11
- fi
8
+ ( ! $root && ! $ error ) && symbol=${GEOMETRY_STATUS_SYMBOL:-▲}
9
+ ( ! $root && $error ) && symbol=${GEOMETRY_STATUS_SYMBOL_ERROR:-△}
10
+ ( $root && ! $error ) && symbol =${GEOMETRY_STATUS_SYMBOL_ROOT:-▼}
11
+ ( $root && $error ) && symbol=${GEOMETRY_STATUS_SYMBOL_ROOT_ERROR:=▽}
12
12
13
- ( $root && $error ) && ansi $color ${GEOMETRY_STATUS_SYMBOL_ROOT_ERROR:=▽} && return
14
- ( $root ) && ansi $color ${GEOMETRY_STATUS_SYMBOL_ROOT:-▼} && return
15
- ( $error ) && ansi $color ${GEOMETRY_STATUS_SYMBOL_ERROR:-△} && return
16
- ansi $color ${GEOMETRY_STATUS_SYMBOL:-▲}
13
+ ansi $color $symbol
Original file line number Diff line number Diff line change 4
4
# pure: https://github.com/sindresorhus/pure
5
5
# mnml: https://github.com/subnixr/minimal
6
6
7
- builtin typeset -gA GEOMETRY; GEOMETRY[ROOT]= ${0 : A : h}
7
+ builtin typeset -gA GEOMETRY
8
8
9
9
(( $+ GEOMETRY_PROMPT)) || GEOMETRY_PROMPT=(geometry_echo geometry_status geometry_path)
10
10
(( $+ GEOMETRY_RPROMPT)) || GEOMETRY_RPROMPT=(geometry_git geometry_hg geometry_jj geometry_echo)
@@ -14,7 +14,7 @@ builtin typeset -gA GEOMETRY; GEOMETRY[ROOT]=${0:A:h}
14
14
15
15
builtin autoload -U add-zsh-hook
16
16
17
- fpath+=(" ${GEOMETRY[ROOT] } " /functions)
17
+ fpath+=(" ${0 : A : h } " /functions)
18
18
autoload -Uz \
19
19
geometry_last_command \
20
20
geometry_docker_machine \
@@ -130,8 +130,7 @@ geometry::rprompt() {
130
130
}
131
131
132
132
geometry::prompt () {
133
- PROMPT=" "
134
- GEOMETRY[LAST_STATUS]=" $status "
133
+ export GEOMETRY_STATUS=$status
135
134
PROMPT=" $( geometry::wrap $PWD $GEOMETRY_PROMPT ) "
136
135
}
137
136
You can’t perform that action at this time.
0 commit comments