Last active
November 28, 2017 10:53
-
-
Save DMeechan/24f16477e3e0724ac9b5d60e357cb704 to your computer and use it in GitHub Desktop.
Remove username@computer from Agonster ZSH Theme
This file contains hidden or 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
# If just logged on normal user, display a short name like 'Daniel' instead of full user account name like 'dmeechan' | |
# But if logged in as a different user (like on SSH), display the full username@machine | |
prompt_context() { | |
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then | |
if [[ "$USER" == "YOUR-USER-ACCOUNT-NAME" ]]; then | |
USER="YOUR-DESIRED-NAME" | |
prompt_segment black default "%(!.%{%F{yellow}%}.)$USER" | |
else | |
prompt_segment black default "%(!.%{%F{yellow}%}.)$USER@%m" | |
fi | |
fi | |
} | |
# EXAMPLE: | |
# prompt_context() { | |
# if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then | |
# if [[ "$USER" == "dmeechan" ]]; then | |
# USER="Daniel" | |
# prompt_segment black default "%(!.%{%F{yellow}%}.)$USER" | |
# else | |
# prompt_segment black default "%(!.%{%F{yellow}%}.)$USER@%m" | |
# fi | |
# fi | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment