1
0

zsh: update

PS: zprof rocks!
This commit is contained in:
2024-02-28 23:22:33 +03:00
parent 47b2170058
commit d872b655c9
18 changed files with 140 additions and 68 deletions

View File

@@ -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
}