Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

POWERLEVEL9K_SHORTEN_STRATEGY="truncate_with_folder_marker" produces incorrect results under $HOME #1272

Open
mr-salty opened this issue May 15, 2019 · 1 comment

Comments

@mr-salty
Copy link

Describe Your Issue

What is happening?
using the truncate_with_folder_marker strategy produced incorrect results under $HOME.

The first issue is, in a subdirectory of $HOME with no folder marker, an extra tilde is produced (~~/xxx).

In a subdirectory of a directory with a folder marker, the directory with the folder marker gets duplicated (~/xxx~/xxx/yyy)

~ > POWERLEVEL9K_SHORTEN_STRATEGY="truncate_with_folder_marker"
~ > mkdir -p xxx/yyy/zzz
~ > touch xxx/.shorten_folder_marker
~ > cd xxx
~~/xxx > cd yyy
~/xxx~/xxx/yyy > cd zzz
~/xxx~/xxx/yyy/zzz >

Have you tried to debug or fix it?

I have a PR (#1271) to fix the first issue; I will also try to fix the second issue

Environment Information

This information will help us understand your configuration.

  • What version of ZSH are you using? You can use zsh --version to see this.
    zsh 5.5 (x86_64-debian-linux-gnu)

  • Do you use a ZSH framework (e.g., Oh-My-ZSH, Antigen)?
    oh-my-zsh

  • How did you install P9k (cloning the repo, by tarball, a package from your OS, etc.,)?
    cloning the repo

  • What version of P9k are you using?
    0.6.7

  • Which terminal emulator do you use?
    gnome-terminal

@romkatv
Copy link

romkatv commented May 15, 2019

While at it, consider fixing another bug in truncate_with_folder_marker. It doesn't respect POWERLEVEL9K_DIR_PATH_ABSOLUTE. That is, if you set POWERLEVEL9K_DIR_PATH_ABSOLUTE=true and POWERLEVEL9K_SHORTEN_STRATEGY=truncate_with_folder_marker, you'll get two kinds of unexpected behavior:

  • When in your home directory, you'll get ~ in the prompt instead of the absolute path to the home directory.
  • Markers in the parent directories of your home directory are ignored.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants