Skip to content

Instantly share code, notes, and snippets.

@iley
Created November 27, 2014 10:02
Show Gist options
  • Save iley/c34c90344c513d5bcf30 to your computer and use it in GitHub Desktop.
Save iley/c34c90344c513d5bcf30 to your computer and use it in GitHub Desktop.
function _prompt_pwd {
local max_len=50
local dir=$(pwd|sed -e "s#^$HOME#~#")
if [ ${#dir} -gt $max_len ]; then
local cut=$(expr ${#dir} - $max_len + 3)
dir="...${dir:$cut}"
fi
echo $dir
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment