zsh: update
PS: zprof rocks!
This commit is contained in:
@@ -1,14 +1,23 @@
|
||||
#!/bin/zsh
|
||||
|
||||
function {
|
||||
z-orig-term() {
|
||||
local -a a
|
||||
local i x
|
||||
|
||||
for i ( ${ZSHU_PARENTS_PID} ) ; do
|
||||
[ -r "/proc/$i/environ" ] || continue
|
||||
x=$(sed -zEn '/^TERM=(.+)$/{s//\1/;p;}' "/proc/$i/environ" 2>/dev/null)
|
||||
x=$(sed -zEn '/^TERM=(.+)$/{s//\1/;p;}' "/proc/$i/environ" 2>/dev/null | tr -d '\0')
|
||||
[ -n "$x" ] || continue
|
||||
a+=( "$x" )
|
||||
done
|
||||
export ORIG_TERM="${a[-1]}"
|
||||
case "$1" in
|
||||
\* | @ )
|
||||
local ORIG_TERM=( $a )
|
||||
declare -p ORIG_TERM
|
||||
;;
|
||||
* )
|
||||
i='-1' ; x="${1:-$i}"
|
||||
echo "${a[$x]}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
Reference in New Issue
Block a user