fix(cli): preserve literal theme browser output

Keep backslash sequences literal and enable prompt-percent rendering independently of the parent shell options. Add PTY coverage for both fixes and verify EXIT-hook preservation through the public CLI.
This commit is contained in:
Robby Russell
2026-09-09 06:13:21 -07:00
parent 3bf157dc77
commit 76439de772
2 changed files with 59 additions and 3 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
# two-line data handoff, while all terminal I/O goes through a private tty fd.
function _omz_theme_browser() (
emulate -L zsh
setopt extendedglob
setopt extendedglob promptpercent
# Displayed names, filter text, and worker output are data, not prompt code.
unsetopt promptsubst
zmodload zsh/terminfo && zmodload zsh/zpty && zmodload zsh/system && zmodload zsh/datetime || return 1
@@ -46,7 +46,7 @@ function _omz_theme_browser() (
done
formatted+=$text
echoti cup $row 0 >&$tty
print -Pn -u $tty -- "%${width}<..<${formatted}%<<%f%k%b"
print -Prn -u $tty -- "%${width}<..<${formatted}%<<%f%k%b"
(( row++ ))
}