Commit 926eecb3 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Set term title from shell prompt

By setting the terminal title from the shell prompt it will be reset
after any commands change it.
parent b11108c9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ source_first ~/.profile /etc/profile

# Prompt
if [ -n "$PS1" ]; then
	PS1="\[\e[1;${PROMPTCOLOUR:-0}m\]\u@\h: \$\[\e[0m\] "
	PS1="\[${PROMPTCODES}\e[1;${PROMPTCOLOUR:-0}m\]\u@\h: \$\[\e[0m\] "
	export PS1
fi

+3 −1
Original line number Diff line number Diff line
@@ -60,7 +60,9 @@ export CLICOLOR=yes
# Set title
# (not suported by linux VT)
if [ "x$TERM" != xlinux ]; then
	printf "\033]0;%s\007" `hostname -f`
	hostname=`hostname -f`
	PROMPTCODES=`printf '\e]2;%s\007' "$hostname"`
	unset hostname
fi

# VT colours
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ function virtualenv_name {
}

# Prompt format
PROMPT='%{$HOST_COLOUR%}%n@%m: $%{$RESET_COLOR%} '
PROMPT='%{$PROMPTCODES%}%{$HOST_COLOUR%}%n@%m: $%{$RESET_COLOR%} '
RPROMPT='%(?:%{$GREEN_BOLD%}$tick:%{$RED_BOLD%}$? $cross)  \
$(virtualenv_name)\
%{$GREEN_BOLD%}$(current_branch)$(git_prompt_short_sha)$(git_prompt_status)\