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.
I went to optimize prompt_dir in Powerlevel10k and noticed that the code is crawling with bugs. Just from the cursory look, here are some.
Tested on master with default settings plus whatever is specified in each test case.
1.
mkdir ~/'%E%K{red}'
cd ~/'%E%K{red}'
Expected content of dir segment: ~/%E%K{red}.
Actual: color mayhem.
2.
mkdir ~/~
cd ~/~
Expected content of dir segment: ~/~.
Actual: ~.
3.
POWERLEVEL9K_DIR_PATH_HIGHLIGHT_BOLD=true POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true
mkdir ~/~
cd ~/~
Expected content of dir segment: /~.
Actual: ~.
Note that with these settings we'll get /foo when we are in ~/foo. I'm assuming here this is the expected behavior of POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER although I cannot imagine why anyone would want this. What's clear is that it should be consistent between ~/foo and ~/~ but currently it isn't.
4.
POWERLEVEL9K_HOME_FOLDER_ABBREVIATION=HOME
sudo mkdir /~
cd /~
Expected content of dir segment: /~.
Actual: /HOME.
I went to optimize
prompt_dir
in Powerlevel10k and noticed that the code is crawling with bugs. Just from the cursory look, here are some.Tested on
master
with default settings plus whatever is specified in each test case.1.
Expected content of dir segment:
~/%E%K{red}
. Actual: color mayhem.2.
Expected content of dir segment:
~/~
. Actual:~
.3.
Expected content of dir segment:
/~
. Actual:~
.Note that with these settings we'll get
/foo
when we are in~/foo
. I'm assuming here this is the expected behavior ofPOWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER
although I cannot imagine why anyone would want this. What's clear is that it should be consistent between~/foo
and~/~
but currently it isn't.4.
Expected content of dir segment:
/~
. Actual:/HOME
.