1
0
mirror of https://github.com/meineerde/dotfiles.git synced 2025-10-17 19:41:01 +00:00

Off-by-one in __short_pwd for PS1

This commit is contained in:
Holger Just 2025-01-21 23:28:07 +01:00
parent 60197d6484
commit 5b8b5a1ae2

View File

@ -327,7 +327,7 @@ ps1_ruby=' \[\e[0;34m\]$(__prompt_ruby_version)\[\e[00m\]'
# Short PWD, if it's to long.
__prompt_short_pwd() {
local FIXED_PWD=${PWD#$HOME}
if [ ${#FIXED_PWD} -le ${#PWD} ]; then
if [ ${#FIXED_PWD} -lt ${#PWD} ]; then
FIXED_PWD="~${FIXED_PWD}"
else
FIXED_PWD="${PWD}"