A one-liner:
PS1='\[\e]0;$( [ "$PS1TITLE" == "" ] || echo -n "$PS1TITLE : ")${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
When the variable PS1TITLE is set, its contents shows up in the window's titlebar.