Skip to content

Instantly share code, notes, and snippets.

@renbaoshuo
Created September 8, 2021 12:14
Show Gist options
  • Save renbaoshuo/93f75878fe29cf9ad48a675abd69ef97 to your computer and use it in GitHub Desktop.
Save renbaoshuo/93f75878fe29cf9ad48a675abd69ef97 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
@SiddheshKukade
Copy link

How can I use this sir ?

@renbaoshuo
Copy link
Author

How can I use this sir ?

@SiddheshKukade Install oh-my-zsh and put this file in ~/.oh-my-zsh/custom/themes/ folder, then change the theme option to "codespaces".

@SiddheshKukade
Copy link

@renbaoshuo Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment