Skip to content

Commit d028cca

Browse files
committed
fix
1 parent a03617c commit d028cca

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/plugins/terminal/scripts/init-alpine.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,15 @@ export PIP_BREAK_SYSTEM_PACKAGES=1
9494
9595
# Smart path shortening function (fish-style: ~/p/s/components)
9696
_shorten_path() {
97-
local path="${PWD/#$HOME/\~}"
97+
local path="$PWD"
98+
99+
if [[ "$HOME" != "/" && "$path" == "$HOME" ]]; then
100+
echo "~"
101+
return
102+
elif [[ "$HOME" != "/" && "$path" == "$HOME/"* ]]; then
103+
path="~${path#$HOME}"
104+
fi
105+
98106
[[ "$path" == "~" ]] && echo "~" && return
99107
100108
local parts result=""

0 commit comments

Comments
 (0)