Bug Description
The ZSH widget displays raw ANSI escape codes instead of rendering colored text.
Observed Behavior
When typing in the shell, the suggestion appears with literal escape sequences:
➜ /tmp claude --dangerously-skip-permissions --resume^[[90m ^[[0m
The ^[[90m (gray) and ^[[0m (reset) codes are shown as text instead of being interpreted.
Expected Behavior
The suggestion text should appear in gray without visible escape codes.
Root Cause
In the zsh-widget output, the code uses:
POSTDISPLAY=$'\e[90m'"$POSTDISPLAY"$'\e[0m'
ZSH's POSTDISPLAY does not interpret ANSI escape sequences in all terminal/configuration contexts.
Suggested Fix
Use ZSH prompt expansion syntax instead of ANSI escapes:
POSTDISPLAY="%F{240}${POSTDISPLAY}%f"
Or use zle region highlighting:
region_highlight=("$#BUFFER $((#BUFFER + #POSTDISPLAY)) fg=gray")
Environment
- aprender-shell 0.1.0
- ZSH with oh-my-zsh (Powerlevel10k theme suspected)
- Linux
Reproduction
cargo install aprender-shell
aprender-shell train
aprender-shell zsh-widget >> ~/.zshrc
source ~/.zshrc
- Start typing a command
Bug Description
The ZSH widget displays raw ANSI escape codes instead of rendering colored text.
Observed Behavior
When typing in the shell, the suggestion appears with literal escape sequences:
The
^[[90m(gray) and^[[0m(reset) codes are shown as text instead of being interpreted.Expected Behavior
The suggestion text should appear in gray without visible escape codes.
Root Cause
In the
zsh-widgetoutput, the code uses:ZSH's
POSTDISPLAYdoes not interpret ANSI escape sequences in all terminal/configuration contexts.Suggested Fix
Use ZSH prompt expansion syntax instead of ANSI escapes:
POSTDISPLAY="%F{240}${POSTDISPLAY}%f"Or use
zleregion highlighting:region_highlight=("$#BUFFER $((#BUFFER + #POSTDISPLAY)) fg=gray")Environment
Reproduction
cargo install aprender-shellaprender-shell trainaprender-shell zsh-widget >> ~/.zshrcsource ~/.zshrc