Created
September 8, 2021 12:14
-
-
Save renbaoshuo/93f75878fe29cf9ad48a675abd69ef97 to your computer and use it in GitHub Desktop.
GitHub Codespaces zsh Theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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
@SiddheshKukade Install oh-my-zsh and put this file in
~/.oh-my-zsh/custom/themes/
folder, then change the theme option to "codespaces".