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

Prompt gap is shorter than it should be #241

Closed
romkatv opened this issue Oct 1, 2019 · 5 comments
Closed

Prompt gap is shorter than it should be #241

romkatv opened this issue Oct 1, 2019 · 5 comments

Comments

@romkatv
Copy link
Owner

romkatv commented Oct 1, 2019

Copied from https://twitter.com/0xKruzr/status/1178779412847878144:

Any idea why this seems to happen on Mac? (misaligned right side frame) Tried it with Terminal and iTerm.

image

@romkatv
Copy link
Owner Author

romkatv commented Oct 1, 2019

I'll need more information to debug this. Please post the output of the following command.

typeset -m 'POWERLEVEL9K_*|ZSH_VERSION|COLUMNS|ZLE_RPROMPT_INDENT'

@jdkruzr
Copy link

jdkruzr commented Oct 1, 2019

╭─    ~ ──────────────────────────────────────── ✔  2.3.0   with jtd @  Fornacis  at 17:10:39  ─╮
╰─ typeset -m 'POWERLEVEL9K_*|ZSH_VERSION|COLUMNS|ZLE_RPROMPT_INDENT'                                97%  ─╯
POWERLEVEL9K_PROMPT_CHAR_OK_VIVIS_FOREGROUND=76
POWERLEVEL9K_NORDVPN_FOREGROUND=39
POWERLEVEL9K_PROMPT_CHAR_OK_VIVIS_CONTENT_EXPANSION=Ⅴ
POWERLEVEL9K_SHORTEN_DELIMITER=''
POWERLEVEL9K_RVM_SHOW_PREFIX=false
POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=''
POWERLEVEL9K_CONTEXT_TEMPLATE='\uf2be%n%246F @ \uf878 %180F%m'
POWERLEVEL9K_OS_ICON_FOREGROUND=255
POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=178
POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=39
POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40
POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
POWERLEVEL9K_BATTERY_CHARGED_FOREGROUND=70
POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=66
POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=37
POWERLEVEL9K_PROXY_FOREGROUND=68
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( os_icon dir vcs newline )
POWERLEVEL9K_PROMPT_CHAR_ERROR_VIINS_CONTENT_EXPANSION=❯
POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false
POWERLEVEL9K_VCS_CLEAN_FOREGROUND=76
POWERLEVEL9K_PUBLIC_IP_FOREGROUND=94
POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B6'
POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true
POWERLEVEL9K_BATTERY_VERBOSE=false
POWERLEVEL9K_VCS_LOADING_CONTENT_EXPANSION='${P9K_CONTENT:-${${VCS_STATUS_LOCAL_BRANCH:+ ${${${$(( ${#VCS_STATUS_LOCAL_BRANCH}<=32 )):#0}:+${VCS_STATUS_LOCAL_BRANCH//\%/%%}}:-${${VCS_STATUS_LOCAL_BRANCH:0:12}//\%/%%}…${${VCS_STATUS_LOCAL_BRANCH: -12}//\%/%%}}}:-@${VCS_STATUS_COMMIT:0:8}}${${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH}:+:${VCS_STATUS_REMOTE_BRANCH//\%/%%}}${VCS_STATUS_TAG:+#${VCS_STATUS_TAG//\%/%%}}${${VCS_STATUS_COMMITS_BEHIND:#0}:+ ⇣${VCS_STATUS_COMMITS_BEHIND}}${${VCS_STATUS_COMMITS_AHEAD:#0}:+${${(M)VCS_STATUS_COMMITS_BEHIND:#0}:+ }⇡${VCS_STATUS_COMMITS_AHEAD}}${${VCS_STATUS_STASHES:#0}:+ *${VCS_STATUS_STASHES}}${VCS_STATUS_ACTION:+ ${VCS_STATUS_ACTION//\%/%%}}${${VCS_STATUS_NUM_CONFLICTED:#0}:+ ~${VCS_STATUS_NUM_CONFLICTED}}${${VCS_STATUS_NUM_STAGED:#0}:+ +${VCS_STATUS_NUM_STAGED}}${${VCS_STATUS_NUM_UNSTAGED:#0}:+ !${VCS_STATUS_NUM_UNSTAGED}}${${VCS_STATUS_NUM_UNTRACKED:#0}:+ ?${VCS_STATUS_NUM_UNTRACKED}}}'
POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER// }'
POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20
POWERLEVEL9K_PROMPT_CHAR_ERROR_VIINS_FOREGROUND=196
POWERLEVEL9K_RVM_FOREGROUND=168
POWERLEVEL9K_RVM_SHOW_GEMSET=false
POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}'
POWERLEVEL9K_KUBECONTEXT_CLASSES=( '*' DEFAULT )
ZSH_VERSION=5.3
POWERLEVEL9K_RUST_VERSION_FOREGROUND=37
POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=''
POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND=76
POWERLEVEL9K_VCS_CONTENT_EXPANSION='${P9K_CONTENT:-${${VCS_STATUS_LOCAL_BRANCH:+%76F ${${${$(( ${#VCS_STATUS_LOCAL_BRANCH}<=32 )):#0}:+${VCS_STATUS_LOCAL_BRANCH//\%/%%}}:-${${VCS_STATUS_LOCAL_BRANCH:0:12}//\%/%%}%28F…%76F${${VCS_STATUS_LOCAL_BRANCH: -12}//\%/%%}}}:-%f@%76F${VCS_STATUS_COMMIT:0:8}}${${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH}:+%f:%76F${VCS_STATUS_REMOTE_BRANCH//\%/%%}}${VCS_STATUS_TAG:+%f#%76F${VCS_STATUS_TAG//\%/%%}}${${VCS_STATUS_COMMITS_BEHIND:#0}:+ %76F⇣${VCS_STATUS_COMMITS_BEHIND}}${${VCS_STATUS_COMMITS_AHEAD:#0}:+${${(M)VCS_STATUS_COMMITS_BEHIND:#0}:+ }%76F⇡${VCS_STATUS_COMMITS_AHEAD}}${${VCS_STATUS_STASHES:#0}:+ %76F*${VCS_STATUS_STASHES}}${VCS_STATUS_ACTION:+ %196F${VCS_STATUS_ACTION//\%/%%}}${${VCS_STATUS_NUM_CONFLICTED:#0}:+ %196F~${VCS_STATUS_NUM_CONFLICTED}}${${VCS_STATUS_NUM_STAGED:#0}:+ %178F+${VCS_STATUS_NUM_STAGED}}${${VCS_STATUS_NUM_UNSTAGED:#0}:+ %178F!${VCS_STATUS_NUM_UNSTAGED}}${${VCS_STATUS_NUM_UNTRACKED:#0}:+ %39F?${VCS_STATUS_NUM_UNTRACKED}}}'
POWERLEVEL9K_NODEENV_LEFT_DELIMITER=''
POWERLEVEL9K_NORDVPN_CONNECTING_VISUAL_IDENTIFIER_EXPANSION=''
POWERLEVEL9K_TIME_FOREGROUND=66
POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=134
POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=248
POWERLEVEL9K_BATTERY_CHARGING_FOREGROUND=70
POWERLEVEL9K_ANACONDA_SHOW_PYTHON_VERSION=false
POWERLEVEL9K_VCS_PREFIX='%246Fon '
POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 '
POWERLEVEL9K_RAM_FOREGROUND=66
POWERLEVEL9K_VPN_IP_FOREGROUND=81
POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='%244F\uE0B5'
POWERLEVEL9K_PROMPT_CHAR_LEFT_LEFT_WHITESPACE=''
POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=160
POWERLEVEL9K_STATUS_OK=true
POWERLEVEL9K_TERRAFORM_FOREGROUND=38
POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=70
POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION=↵
POWERLEVEL9K_NORDVPN_DISCONNECTING_VISUAL_IDENTIFIER_EXPANSION=''
POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=240
POWERLEVEL9K_DIR_MAX_LENGTH=80
POWERLEVEL9K_VCS_BACKENDS=( git )
POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false
POWERLEVEL9K_VCS_LOADING_FOREGROUND=244
POWERLEVEL9K_VCS_UNTRACKED_ICON='?'
POWERLEVEL9K_PROMPT_CHAR_OK_VICMD_FOREGROUND=76
POWERLEVEL9K_AWS_FOREGROUND=208
POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
POWERLEVEL9K_DIR_ANCHOR_BOLD=true
POWERLEVEL9K_NORDVPN_DISCONNECTED_VISUAL_IDENTIFIER_EXPANSION=''
POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique
POWERLEVEL9K_DIR_SHOW_WRITABLE=true
POWERLEVEL9K_PROMPT_CHAR_BACKGROUND=''
POWERLEVEL9K_BACKGROUND=236
POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER// }'
POWERLEVEL9K_PROMPT_CHAR_ERROR_VIVIS_CONTENT_EXPANSION=Ⅴ
POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
POWERLEVEL9K_GO_VERSION_FOREGROUND=37
POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}'
POWERLEVEL9K_STATUS_ERROR=true
POWERLEVEL9K_DIR_FOREGROUND=31
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=─
POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='${P9K_VISUAL_IDENTIFIER}'
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=%240F─╮
POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B6'
POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=166
POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=%240F─┤
POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
POWERLEVEL9K_ANACONDA_FOREGROUND=37
POWERLEVEL9K_NORDVPN_DISCONNECTED_CONTENT_EXPANSION=''
COLUMNS=112
POWERLEVEL9K_LOAD_WARNING_FOREGROUND=178
POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION=✔
POWERLEVEL9K_PROMPT_CHAR_OK_VICMD_CONTENT_EXPANSION=❮
POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='%244F\uE0B7'
POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=''
POWERLEVEL9K_SHORTEN_FOLDER_MARKER='(.bzr|.citc|.git|.hg|.node-version|.python-version|.ruby-version|.shorten_folder_marker|.svn|.terraform|CVS|Cargo.toml|composer.json|go.mod|package.json)'
POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER=''
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=%240F╭─
POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX=%240F├─
POWERLEVEL9K_NODENV_FOREGROUND=70
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B4'
POWERLEVEL9K_PROMPT_CHAR_OK_VIOWR_CONTENT_EXPANSION=▶
POWERLEVEL9K_PROMPT_CHAR_ERROR_VIVIS_FOREGROUND=196
POWERLEVEL9K_NORDVPN_CONNECTING_CONTENT_EXPANSION=''
POWERLEVEL9K_CONTEXT_PREFIX='%246Fwith '
POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50
POWERLEVEL9K_NVM_FOREGROUND=70
POWERLEVEL9K_EXAMPLE_FOREGROUND=208
POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER=''
POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true
POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=160
POWERLEVEL9K_DIR_HYPERLINK=false
POWERLEVEL9K_VCS_UNSTAGED_MAX_NUM=-1
POWERLEVEL9K_PROMPT_CHAR_OK_VIINS_FOREGROUND=76
POWERLEVEL9K_VCS_STAGED_MAX_NUM=-1
POWERLEVEL9K_VIRTUALENV_FOREGROUND=37
POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX=%240F─╯
POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=178
POWERLEVEL9K_VPN_IP_INTERFACE='(wg|(.*tun))[0-9]*'
POWERLEVEL9K_BATTERY_LOW_FOREGROUND=160
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=( status command_execution_time background_jobs virtualenv anaconda pyenv nodenv nvm nodeenv rbenv rvm kubecontext terraform aws context nordvpn ranger time newline battery )
POWERLEVEL9K_NODEENV_RIGHT_DELIMITER=''
POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
POWERLEVEL9K_VCS_CONFLICTED_MAX_NUM=-1
POWERLEVEL9K_PROMPT_CHAR_LEFT_RIGHT_WHITESPACE=''
POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION=↵
POWERLEVEL9K_ANACONDA_LEFT_DELIMITER=''
POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false
POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='\uf2be%n%246F @ \uf878 %227F%m'
POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160
POWERLEVEL9K_PROMPT_CHAR_OK_VIINS_CONTENT_EXPANSION=❯
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX=%240F╰─
POWERLEVEL9K_STATUS_ERROR_PIPE=true
POWERLEVEL9K_NODEENV_FOREGROUND=70
POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false
POWERLEVEL9K_VCS_COMMITS_BEHIND_MAX_NUM=-1
POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION=✔
POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B6'
POWERLEVEL9K_BATTERY_STAGES=
POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION=''
POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true
POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER=''
POWERLEVEL9K_PYENV_FOREGROUND=37
POWERLEVEL9K_VCS_UNTRACKED_MAX_NUM=-1
POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%246Ftook '
POWERLEVEL9K_STATUS_OK_PIPE=true
POWERLEVEL9K_MODE=nerdfont-complete
POWERLEVEL9K_KUBECONTEXT_PREFIX='%246Fat '
POWERLEVEL9K_VCS_COMMITS_AHEAD_MAX_NUM=-1
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND=''
POWERLEVEL9K_STATUS_ERROR_SIGNAL=true
POWERLEVEL9K_RBENV_FOREGROUND=168
POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=134
POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION=↵
POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B4'
POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true
POWERLEVEL9K_VCS_MODIFIED_FOREGROUND=178
POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}'
POWERLEVEL9K_STATUS_OK_FOREGROUND=70
POWERLEVEL9K_LOAD_WHICH=5
POWERLEVEL9K_CONTEXT_FOREGROUND=180
POWERLEVEL9K_PROMPT_CHAR_ERROR_VICMD_FOREGROUND=196
POWERLEVEL9K_PROMPT_CHAR_ERROR_VICMD_CONTENT_EXPANSION=❮
POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B4'
POWERLEVEL9K_TIME_PREFIX='%246Fat '
POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false
POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false
POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_COLOR=76
POWERLEVEL9K_STATUS_EXTENDED_STATES=true
POWERLEVEL9K_RANGER_FOREGROUND=178
POWERLEVEL9K_PROMPT_CHAR_ERROR_VIOWR_CONTENT_EXPANSION=▶
POWERLEVEL9K_NORDVPN_DISCONNECTING_CONTENT_EXPANSION=''
POWERLEVEL9K_NODE_VERSION_FOREGROUND=70
POWERLEVEL9K_ICON_BEFORE_CONTENT=''
POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=103
POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='%B${P9K_CONTENT// }'

@romkatv
Copy link
Owner Author

romkatv commented Oct 1, 2019

For some reason macOS thinks that U+F878 has zero width. This isn't a font issue but some kind of low level bug. You can see it by running the following code:

echo '123\n\uF878^'

In the output, ^ must point at 2 with any font. But on macOS it always points at 1.

Here's another test. If you run this command, you'll notice that the cursor is at the left margin.

PROMPT=$'\uF878' zsh -f

You can work around this issue like this:

POWERLEVEL9K_CONTEXT_TEMPLATE='\uf2be%n%246F @ \uf878%{ %} %180F%m'
POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='\uf2be%n%246F @ \uf878%{ %} %227F%m'

(I added %{ %} after \uf878.)

You should apply this workaround only on macOS. If you apply it where it's unnecessary, your prompt line will once again be off by one.

@romkatv
Copy link
Owner Author

romkatv commented Oct 3, 2019

I'm assuming the workaround has worked for you. Please reopen the issue if not.

@romkatv romkatv closed this as completed Oct 3, 2019
@jdkruzr
Copy link

jdkruzr commented Oct 10, 2019

Thank you! This resolves the problem.

romkatv added a commit that referenced this issue Jun 10, 2021
96b520b2 build v1.5.1 binaries for all platforms
ffeb0507 bump version to v1.5.1
1bcbea07 mbuild: disable pacman upgrades on msys
39dbb92f log a warning if unable to parse packed-refs
a9d70ec0 add `-r` flag to gitstatus_start in bash bindings (#241)
abbf9a79 don't use static_assert with one argument as it's not available prior to c++17 (#239)
f8c396e4 drop all tags if packed-refs doesn't have a header line (#1428)

git-subtree-dir: gitstatus
git-subtree-split: 96b520b248ca872646e27b3df4535898356e4637
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