Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vcs is not hidden when using p10k-on-post-prompt in multiline prompt #2129

Open
rweglarz opened this issue Dec 19, 2022 · 1 comment
Open

Comments

@rweglarz
Copy link

First of all thank you for powerlevel10k, it's great.

I'm struggling to hide vcs in multiline prompt.

If I do all in one line - it works:

  typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
    context                 # user@hostname
    dir                     # current directory
    vcs                     # git status
    prompt_char             # prompt symbol
  ) 
    
  function p10k-on-pre-prompt()  {
    p10k display '1/left/*'=show '1/left/prompt_char'=hide
  }

  function p10k-on-post-prompt() {
    p10k display '1/left/*'=hide '1/left/prompt_char'=show                                                                                                             
  }

but this does not:

  typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
    newline                
    newline
    context                 # user@hostname
    dir                     # current directory
    vcs                     # git status
    prompt_char             # prompt symbol
  ) 

  function p10k-on-pre-prompt()  {
    p10k display '3/left/*'=show '3/left/prompt_char'=hide
  }

  function p10k-on-post-prompt() {
    p10k display '3/left/*'=hide '3left/prompt_char'=show                                                                                                             
  }

prompt looks like so (note the dir does get hidden)

 master ?10 ❯ 

 ~/prog/c | master ?10 > 

This also seems to imply it is hidden:

❯ p10k display -a '*' && printf '%-32s = %q\n' ${(@kv)reply} | sort
...
3/left/vcs                       = hide
...

I do have RIGHT_PROMPT but it does not seem to influence this behavior.

thank you

@romkatv
Copy link
Owner

romkatv commented Dec 19, 2022

I've reproduced this. vcs does not get hidden if it's on the last line of a multi-line prompt. vcs has special rendering, so there is probably a bug somewhere in that part of the code. No ETA yet.

By the way, you can test this by invoking p10k display '*/vcs'=hide on the command line without hooks.

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

No branches or pull requests

2 participants