-
Notifications
You must be signed in to change notification settings - Fork 943
[Next] Issue with leftPromptWidth #1372
Comments
I think You can use the following command to diagnose this problem. () {
emulate -L zsh
setopt err_return no_unset
local text
print -rl -- 'Select a part of your prompt from the terminal window and paste it below.' ''
read -r '?Prompt: ' text
local -i len=${(m)#text}
local frame="+-${(pl.$len..-.):-}-+"
print -lr -- $frame "| $text |" $frame
} If the prompt line aligns with the frame
If the output of the command is aligned for every part of your prompt (left and right), this indicates a bug in the theme. Use this command to diagnose it: print -rl -- ${(eq+)PROMPT} ${(eq+)RPROMPT} Look for If the prompt line is longer than the frame
This is usually caused by a terminal bug or misconfiguration that makes it print ambiguous-width characters as double-width instead of single width. For example, this issue. If the prompt line is shorter than the frame and is mangled
Note that this prompt is different from the original as it's missing a space after the checkmark. This can be caused by a low-level bug in macOS. See this issue. If the prompt line is shorter than the frame and is not mangled
This can be caused by misconfigured locale. See this issue. Since you have two different prompts (one succeeding the other with a short delay) that get positioned differently, you might have to run these tests on both. Tip: Once you find a part of your prompt that causes misaligned output, it's a good idea to reduce it to the minimum. Ideally, to a single character. If you decide to debug your problem, please post the outcome of your attempt (and new methods, should you devise any). Debugging such issues when they are reported by users is very time consuming. It helps to accumulate and pool experience to save time in the future. |
Describe Your Issue
What is happening?
leftPromptWidth
is calculating the incorrect length. There is extra padding on the right prompt for a few seconds and then it disappears and the cursor is in the wrong place. This also happens during tab completionNotice the command doubling...
Have you tried to debug or fix it?
Not yet.
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.7.1 (x86_64-apple-darwin18.2.0)
Do you use a ZSH framework (e.g., Oh-My-ZSH, Antigen)?
No
How did you install P9k (cloning the repo, by tarball, a package from your OS, etc.,)?
cloning
What version of P9k are you using?
Next
Which terminal emulator do you use?
iTerm 2
The text was updated successfully, but these errors were encountered: