Skip to content

Add "c" command to generate escape sequences for a given style#160

Open
bendavis78 wants to merge 1 commit into
sharkdp:masterfrom
bendavis78:c-option
Open

Add "c" command to generate escape sequences for a given style#160
bendavis78 wants to merge 1 commit into
sharkdp:masterfrom
bendavis78:c-option

Conversation

@bendavis78

Copy link
Copy Markdown

This adds a "c" command which will generate the escape sequence for a style defined in the given theme category. This is allows me to do automate colors for my prompt in .bashrc/.zshrc, for example:

export VIVID_THEME="catppuccin-mocha"
icon_style="$(vivid c programming.source)";
dir_style="$(vivid c core.directory)";
reset="$(vivid c reset)";

[[ -z "$ICON" ]] && ICON=""

PROMPT="%{${icon_style}%}${ICON} "
PROMPT+=" %{${dir_style}%}%c%{$reset%} "
export PROMPT
export CLICOLOR=1
export LS_COLORS="$(vivid generate)"

@sharkdp

sharkdp commented Aug 31, 2025

Copy link
Copy Markdown
Owner

This looks interesting, thank you very much for your contribution! Can we find a better (longer) name for this option? If it's mainly used in scripts, I would prefer a self-descriptive name over something short.

It would also be great to add an integration test to tests/main.rs.

@rpdelaney rpdelaney added the question Further information is requested label Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants