Created
October 2, 2012 18:08
-
-
Save pjz/3821862 to your computer and use it in GitHub Desktop.
Set prompt to fqdn - domain.toplevel
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
# This will change your prompt and screen/tmux tab title based on how many | |
# fields there are in the FQDN. For a normal 3 field FQDN, it will use $HOSTNAME | |
# like normal. For 4+ fields it will set it to field1.field2. | |
# Rename screen window | |
function rename_screen_tab () { echo -ne "\x1bk$@\x1b\\"; return 0; } | |
MYHOST=`echo $HOSTNAME | sed 's/[.][^.]*[.][^.]*$//'` | |
[[ $TERM == "screen" ]] && PROMPT_COMMAND='rename_screen_tab ${MYHOST}' | |
PS1="\d \A \w\n\u@$MYHOST > " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment