Skip to content

Instantly share code, notes, and snippets.

@cybertramp
Created December 29, 2022 01:24
Show Gist options
  • Save cybertramp/dd009f863982fb32c1592ab827024092 to your computer and use it in GitHub Desktop.
Save cybertramp/dd009f863982fb32c1592ab827024092 to your computer and use it in GitHub Desktop.
oh-my-bash remove hostname
##
## You can remove display hostname partion
##
## Path: ~/.oh-my-bash/themes/agnoster/agnoster.theme.sh
##
## modify prompt_context() function
##
prompt_context() {
local user=$(whoami)
if [[ $user != $DEFAULT_USER || -n $SSH_CLIENT ]]; then
# >>> Original
#prompt_segment black default "$user@\h"
# >>> Modified
prompt_segment black default "$user"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment