summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorjabunovoty <jakub.novotny1@gmail.com>2023-07-25 10:31:24 +0200
committerGitHub <noreply@github.com>2023-07-25 10:31:24 +0200
commit4188b22aea3356a02768505103e42a96d18547a3 (patch)
treed1c2e42f4573e27c60b5cc19c3c615055669d5a3 /themes
parente564793939a086fc4c46628b193a38997ea4ecb3 (diff)
downloadzsh-4188b22aea3356a02768505103e42a96d18547a3.tar.gz
zsh-4188b22aea3356a02768505103e42a96d18547a3.tar.bz2
zsh-4188b22aea3356a02768505103e42a96d18547a3.zip
feat(agnoster): add git tag to prompt (#8417)
Co-authored-by: Jakub Novotny <jakub.novotny@deutsche-boerse.com>
Diffstat (limited to 'themes')
-rw-r--r--themes/agnoster.zsh-theme4
1 files changed, 3 insertions, 1 deletions
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index 88854eccd..aa274a5bb 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -109,7 +109,9 @@ prompt_git() {
if [[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]]; then
repo_path=$(git rev-parse --git-dir 2>/dev/null)
dirty=$(parse_git_dirty)
- ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git rev-parse --short HEAD 2> /dev/null)"
+ ref=$(git symbolic-ref HEAD 2> /dev/null) || \
+ ref="◈ $(git describe --exact-match --tags HEAD 2> /dev/null)" || \
+ ref="➦ $(git rev-parse --short HEAD 2> /dev/null)"
if [[ -n $dirty ]]; then
prompt_segment yellow black
else