-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Hi, as said in your TODO file, you have yet another implementation of ansi-color sequences in prompt_wunjo_setup. Using tput would indeed be nice, but I think it should be the responsability of someone refactoring the colors module.
For your prompt, using zstyle and zformat seems more to the poinf, as it would allow users to organize the whole messages (and display colors as they like). For instance, I like minimal prompts, so I'd prefer limit git information to short symbols about the branch and dirty status.
I took the liberty of adapting your prompt_wunjo_scm_branch function for my own use, and here's what it looks like:
function promptinfo_git_status() {
zgit_isgit || return
local msg
if zgit_inworktree; then
local fmt
zstyle -s ':promptinfo:' git-status fmt
[[ -z ${fmt} ]] && fmt='%(i.-.+)%(w.-.*)%(m.!.-)%(t.?.-)'
zformat -f msg ${fmt} \
i:$(status zgit_isindexclean) \
w:$(status zgit_isworktreeclean) \
m:$(status zgit_hasunmerged) \
t:$(status zgit_hasuntracked)
fi
echo -n ${msg}
}
function status() { "$@"; echo $? } # needed because your functions don't echo anything themselvesReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels