# prompt.zsh — Rose Pine two-line prompt + sane shell options.
[ -n "${ZSH_VERSION:-}" ] || return 0
# --- history & options ------------------------------------------------------
HISTFILE="${HISTFILE:-$HOME/.zsh_history}"
HISTSIZE=100000
SAVEHIST=100000
setopt prompt_subst
setopt hist_ignore_all_dups hist_ignore_space hist_reduce_blanks share_history
setopt inc_append_history extended_history
setopt auto_cd auto_pushd pushd_ignore_dups interactive_comments
setopt no_beep
# --- git segment ------------------------------------------------------------
_pe_git() {
local b; b=$(git symbolic-ref --short HEAD 2>/dev/null) || return
local dirty=''; git diff --quiet --ignore-submodules HEAD 2>/dev/null || dirty='*'
print -rn -- " %F{#ebbcba}( ${b}${dirty})%f"
}
# --- active-target segment (RPROMPT) — reads the plaintext cache, no DB ------
_pe_rprompt_target() {
[[ -f $PE_ACTIVE_DISPLAY_FILE ]] || return
local t; t=$(<"$PE_ACTIVE_DISPLAY_FILE"); [[ -n $t ]] || return
print -rn -- "%K{#eb6f92}%F{#191724} ⚑ ${t} %f%k"
}
# Rose Pine: iris frame, foam user@host, gold path, rose git, pine/love arrow.
PROMPT='%F{#c4a7e7}┌─[%F{#9ccfd8}%n@%m%F{#c4a7e7}]─[%F{#f6c177}%~%F{#c4a7e7}]$(_pe_git)
%F{#c4a7e7}└─%(?.%F{#9ccfd8}.%F{#eb6f92})❯%f '
RPROMPT='$(_pe_rprompt_target)'