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

Duplicated Prompt #2793

Open
xela1601 opened this issue Nov 17, 2024 · 7 comments
Open

Duplicated Prompt #2793

xela1601 opened this issue Nov 17, 2024 · 7 comments

Comments

@xela1601
Copy link

xela1601 commented Nov 17, 2024

Hello there,

first of all - thanks for the awesome shell extension. Really enjoying it - i.e. the setup process is very user friendly.

The only thing I want to complain about is that the prompt is sometimes showing up in a duplicated manner, as you can see in the screenshot below. This usually happens after a "clear" command and waiting for some time. I did not even press enter or anything in the terminal. I also have it configured in a way that only the latest prompt that is active should be styled in this way (don't know the exact name of that setting, but I could configure this during the setup process in the beginning)
Let me know if you need more information about this.

CleanShot 2024-11-17 at 10 39 30

@romkatv
Copy link
Owner

romkatv commented Nov 17, 2024

See https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#horrific-mess-when-resizing-terminal-window. If you aren't manually resizing the terminal, it's possible that the terminal is doing it on its own when something special is happening (e.g., it might do that when the computer goes to sleep or wakes up).

@xela1601
Copy link
Author

xela1601 commented Nov 17, 2024

@romkatv thanks for this really fast reply. Indeed this can be reproduced when i resize the terminal window. I'm using the iTerm2 application as well as the integrated terminal within intelliJ and it happens in both of them. Which mitigation listed in that readme would u recommend me?

@romkatv
Copy link
Owner

romkatv commented Nov 17, 2024

You can either change your prompt as described in the last bullet point here, or use zsh4humans.

@xela1601
Copy link
Author

xela1601 commented Nov 17, 2024

i tried to adjust the settings as stated in the last bullet point by adding these to my .zshrc:

export POWERLEVEL9K_SHOW_RULER=false
export POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '
export POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=''
export POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=''
export POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX=''
export POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()

the issue is still not resolved this way.
Probably i need to set these somewhere else like in the .p10k.zsh file?

@romkatv
Copy link
Owner

romkatv commented Nov 17, 2024

Probably i need to set these somewhere else like in the .p10k.zsh file?

Good guess. This is also stated in your .zshrc that you've just edited.

@xela1601
Copy link
Author

xela1601 commented Nov 17, 2024

Ok, now the lines from above are on the bottom of the .p10k.zsh-file. Ofc i also sourced .zshrc again. But still the issue persists.

Edit: also using typeset -g instead of export did not help

@romkatv
Copy link
Owner

romkatv commented Nov 17, 2024

https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#weird-things-happen-after-typing-source-zshrc

If the issue is still happening, keep removing things from your prompt until there are no long lines between the start of prompt and cursor. Refer to the doc if this isn't clear.

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