aboutsummaryrefslogtreecommitdiff
path: root/bashrc.d/title
blob: e391855c59e3df5bc7a049586b77328ac208f4ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# vim: ft=sh

function settitle {
	if command -v whoami >/dev/null && command -v hostname >/dev/null && command -v pwd >/dev/null; then
		echo -ne "\033]0;$(whoami)@$(hostname):$(pwd)\007"
	fi
}

case "$TERM" in
	xterm*|*rxvt*|*st*)
		trap 'settitle' DEBUG
		;;
esac