Powerlevel9k / powerlevel9k

Powerlevel9k was a tool for building a beautiful and highly functional CLI, customized for you. P9k had a substantial impact on CLI UX, and its legacy is now continued by P10k.
https://github.com/romkatv/powerlevel10k
MIT License
13.46k stars 948 forks source link

POWERLEVEL9K_SHORTEN_STRATEGY=truncate_with_package_name doesn't work #1296

Open romkatv opened 5 years ago

romkatv commented 5 years ago

This is on master.

To reproduce:

docker run -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 -e TERM=$TERM -it --rm ubuntu bash -uexc '
  apt update && apt install -y zsh git jq
  git clone https://github.com/bhilburn/powerlevel9k.git ~/powerlevel9k
  cd ~/powerlevel9k
  echo "{\"name\":\"x\"}" >package.json
  echo "
    POWERLEVEL9K_SHORTEN_STRATEGY=truncate_with_package_name
    source ~/powerlevel9k/powerlevel9k.zsh-theme" >~/.zshrc
  exec zsh'

Expected: the current directory in the prompt is displayed as x.

Actual: the current directory in the prompt is displayed as ~/powerlevel9k and there is an error message: truncatePath:4: bad math expression: illegal character: \.