powerlevel10k icon indicating copy to clipboard operation
powerlevel10k copied to clipboard

Powerlevel10k Prompt Character Bleeding into Command Output

Open saransh09 opened this issue 5 months ago • 0 comments

Environment

• OS: macOS (Darwin) • Shell: zsh with oh-my-zsh • Theme: powerlevel10k/powerlevel10k • Terminal: ghostty

Issue Description

The Powerlevel10k prompt suffix character ─╯ (UTF-8 bytes: e2 94 80 e2 95 af) appears to bleed into terminal output under certain conditions, causing data corruption when that output is captured or used programmatically.

Specific manifestation:

• Running git config --global user.email (without arguments) to read the current value • The output visually shows or somehow captures the prompt suffix character ─╯ • This corrupted output can then accidentally be written back to .gitconfig through copy-paste or command mishaps • Result: .gitconfig file contains email = ─╯ instead of actual email address

Configuration

The prompt character is defined in .p10k.zsh:149:

POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX='%240F─╯'

Evidence from .zsh_history

Hex Dump of Corrupted .gitconfig

00000000 5b 75 73 65 72 5d 0a 09 65 6d 61 69 6c 20 3d 20 |[user]..email = | 00000010 e2 94 80 e2 95 af 0a 09 6e 61 6d 65 20 3d 20 53 |........name = S|

Bytes e2 94 80 e2 95 af = ─╯

Reproduction

Unable to reliably reproduce - appears to be a race condition or timing issue between:

• Command output rendering • Prompt rendering • Terminal buffer state

Workaround

Explicitly resetting the config value fixes the corruption:

git config --global --unset user.email git config --global user.email "[email protected]"

Impact

High - Can silently corrupt configuration files or any captured command output, leading to:

• Broken git configuration • Failed authentication • Data integrity issues in scripts that capture command output

Additional Context

The instant prompt is enabled in .zshrc:

if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi

saransh09 avatar Nov 04 '25 20:11 saransh09