"${PWD##*/}"

# fetch only the last directory from `$PWD/`
cur_dir=${PWD##*/}
# correct for case where `$PWD=/`, normally would be blank, this makes it become `/`
cur_dir=${cur_dir:-/}
