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 946 forks source link

dir module printing message "Please ask your administrator." at root level #1318

Open azuretheseeker opened 5 years ago

azuretheseeker commented 5 years ago

On new user installation on ubuntu 18.04, the dir module for the left prompt is displaying a message that says "Please ask your administrator." at the root folder level and squeezing out the actual dir information to be irrelevant.

PL9KBug

The issue goes away (along with any dir information) when the dir module is taking out of the left prompt:

Issue Persists With This: POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(root_indicator context dir_writable dir anaconda vcs)

No Issue With This: POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(root_indicator context dir_writable anaconda vcs)

Environment Information

zsh 5.4.2 (x86_64-ubuntu-linux-gnu) Oh-My-ZSH Installed by cloning the repo from latest github xfce4-terminal

romkatv commented 5 years ago

That's an intriguing message. What's the output of echo $POWERLEVEL9K_SHORTEN_STRATEGY ?

azuretheseeker commented 5 years ago

echo $POWERLEVEL9K_SHORTEN_STRATEGY

truncate_with_package_name

romkatv commented 5 years ago

It's possible that the prompt recommends to chat up your system administrator to install jq. Unfortunately, installing jq won't fix your prompt because there is another bug in truncate_with_package_name: https://github.com/bhilburn/powerlevel9k/issues/1296. It works in powerlevel10k though.

azuretheseeker commented 5 years ago

The issue is definitely with a command that the dir module is running that isn't installed or accessible or in the path for the user. To clarify:

  1. All modules for default user on the ubuntu system works
  2. For the newly created user, with a fresh install of oh-my-zsh, powerlevel9K and latest zsh package from ubuntu, we get the error.

I have admin access and installed jq but that didn't resolve the issue. I have the zsh-better-npm-completion plugin for zsh, which for any binary that's not found gives a message similar to what's displayed on the prompt. As an example, this is an attempt (unrelated binary):

> qube
WARNING:root:could not open file '/etc/apt/sources.list.d/signal-xenial.list'

Command 'qube' not found, but can be installed with:

apt install avogadro
Please ask your administrator.

What are other dependencies for dir module that I can check besides jq?

romkatv commented 5 years ago

Dunno. It could be many things. If you can reproduce it with powerlevel10k, I'll debug it.

azuretheseeker commented 5 years ago

Thanks Romka. Will take a look at powerlevel10K, looks like a promising project. Just want to go one step at a time in updates, so it would be great to make this work with 9K, if anybody else has an idea about what may be missing?