From 1e1a3f3f749dbddbebede3a304cb7bb1fab3b249 Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Tue, 7 Apr 2026 15:26:49 +0200 Subject: [PATCH] zsh: customize prompt to match old colors --- README.md | 2 +- prompt.patch | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 prompt.patch diff --git a/README.md b/README.md index c918118..0fb0e9a 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ sudo apt install \ ``` ``` -git clone https://github.com/ohmyzsh/ohmyzsh/ $HOME/.oh-my-zsh +git clone https://github.com/ohmyzsh/ohmyzsh/ $HOME/.oh-my-zsh && cd $HOME/.oh-my-zsh && git apply $HOME/.dots/prompt.patch ``` ### Extended diff --git a/prompt.patch b/prompt.patch new file mode 100644 index 0000000..b2440cf --- /dev/null +++ b/prompt.patch @@ -0,0 +1,33 @@ +diff --git a/lib/git.zsh b/lib/git.zsh +index 8d38f326..32c55ead 100644 +--- a/lib/git.zsh ++++ b/lib/git.zsh +@@ -36,7 +36,13 @@ function _omz_git_prompt_info() { + && upstream=" -> ${upstream}" + fi + +- echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}" ++ local is_nix ++ if $(echo $PATH | grep "/nix/store" > /dev/null 2>&1); then ++ is_nix="nix@" ++ fi ++ ++ ++ echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${is_nix}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}" + } + + function _omz_git_prompt_status() { +diff --git a/themes/afowler.zsh-theme b/themes/afowler.zsh-theme +index f6d3ef82..c1e59b4f 100644 +--- a/themes/afowler.zsh-theme ++++ b/themes/afowler.zsh-theme +@@ -1,7 +1,7 @@ +-PROMPT='%m %B%F{blue}:: %b%F{green}%3~ $(hg_prompt_info)$(git_prompt_info)%B%(!.%F{red}.%F{blue})»%f%b ' ++PROMPT='%b%F{yellow}%m %B%F{black}:: %b%F{blue}%3~ $(hg_prompt_info)$(git_prompt_info)%B%(!.%F{red}.%F{black})»%f%b ' + RPS1='%(?..%F{red}%? ↵%f)' + +-ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" ++ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹" + ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}" + + ZSH_THEME_HG_PROMPT_PREFIX="%{$fg[magenta]%}hg:‹%{$fg[yellow]%}"