mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-12 08:50:08 +00:00
fishy: fix one-level directory bug and bad array assignment in zsh 5.0.1
This commit is contained in:
parent
a7f5170d68
commit
7256c03ce1
1 changed files with 11 additions and 8 deletions
|
@ -1,14 +1,17 @@
|
|||
# ZSH Theme emulating the Fish shell's default prompt.
|
||||
|
||||
_fishy_collapsed_wd() {
|
||||
local -a pwd=("${(s:/:)PWD/#$HOME/~}")
|
||||
for i in {1..$(($#pwd-1))}; do
|
||||
if [[ "$pwd[$i]" = .* ]]; then
|
||||
pwd[$i]="${${pwd[$i]}[1,2]}"
|
||||
else
|
||||
pwd[$i]="${${pwd[$i]}[1]}"
|
||||
fi
|
||||
done
|
||||
local i pwd
|
||||
pwd=("${(s:/:)PWD/#$HOME/~}")
|
||||
if (( $#pwd > 1 )); then
|
||||
for i in {1..$(($#pwd-1))}; do
|
||||
if [[ "$pwd[$i]" = .* ]]; then
|
||||
pwd[$i]="${${pwd[$i]}[1,2]}"
|
||||
else
|
||||
pwd[$i]="${${pwd[$i]}[1]}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
echo "${(j:/:)pwd}"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue