shorten path: properly escape \ (bash) or % (zsh)
This commit is contained in:
parent
5b52a1d4d0
commit
83b0ea8ea8
@ -575,8 +575,12 @@ _lp_shorten_path()
|
||||
ret="${ret}${mask}${p:${#p} - ${len_left}}${base}"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "${ret}"
|
||||
# Escape special chars
|
||||
if $_LP_SHELL_bash; then
|
||||
LP_PWD="${ret/\\/\\\\}"
|
||||
else # zsh
|
||||
LP_PWD="${ret/%/%%}"
|
||||
fi
|
||||
}
|
||||
|
||||
# In bash shell, PROMPT_DIRTRIM is the number of directory to keep at the end
|
||||
|
Loading…
x
Reference in New Issue
Block a user