Skip to content

Instantly share code, notes, and snippets.

@andatoshiki
Forked from renbaoshuo/codespaces.zsh-theme
Created November 13, 2022 10:45
Show Gist options
  • Save andatoshiki/22af77610c8150bc5afa4fce2c7eb8f3 to your computer and use it in GitHub Desktop.
Save andatoshiki/22af77610c8150bc5afa4fce2c7eb8f3 to your computer and use it in GitHub Desktop.
GitHub Codespaces zsh Theme
# Codespaces zsh prompt theme
__zsh_prompt() {
local prompt_username
if [ ! -z "${GITHUB_USER}" ]; then
prompt_username="@${GITHUB_USER}"
else
prompt_username="%n"
fi
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
PROMPT+='$(git_prompt_info)%{$fg[white]%}$ %{$reset_color%}' # Git status
unset -f __zsh_prompt
}
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}(%{$fg_bold[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg_bold[yellow]%}✗%{$fg_bold[cyan]%})"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[cyan]%})"
__zsh_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment