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

@@ -23,13 +23,13 @@ zstyle ':completion:*:*:*:*:processes' command "ps -u ${USER} -o pid,user,comm -
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
zstyle ':completion:*:kill:*' command 'ps -u ${USER} -o pid,%cpu,tty,cputime,cmd'
autoload -Uz +X compinit && \
compinit -i -C -d "${ZSHU[f_compdump]}"
if autoload -Uz +X bashcompinit ; then
bashcompinit && ZSHU[compdump_bash]=1
fi
autoload -Uz +X compinit && \
compinit -i -C -d "${ZSHU[f_compdump]}"
for i ( "${ZSHU[d_conf]}"/completion/*.zsh(N.r) ) ; do
source "$i"
done ; unset i

View File

@@ -5,6 +5,5 @@ if [ -n "${PAGER}" ] ; then
export PAGER
READNULLCMD=$(which "${PAGER}" | xargs -r readlink -e)
else
unset READNULLCMD
unset NULLCMD
unset PAGER READNULLCMD NULLCMD
fi

View File

@@ -78,7 +78,7 @@ function {
ZSHU_PS1[1L]="${(j::)line}"
}
z-ps() {
z-ps1() {
[ -n "$1" ] || {
echo "${ZSHU_PS[ps1]}"
return
@@ -95,6 +95,6 @@ z-ps() {
return 1
}
z-ps 3
[ "${ZSHU_RUN[nested]}" = 1 ] && z-ps 2
[ "${ZSHU_RUN[nested1L]}" = 1 ] && z-ps 1
z-ps1 3
[ "${ZSHU_RUN[nested]}" = 1 ] && z-ps1 2
[ "${ZSHU_RUN[nested1L]}" = 1 ] && z-ps1 1

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
}