Most terminal programs - including konsole, putty and xterm - emulate the old VT100 terminal. This terminal allows you to set certain things, including bold, colors, setting the terminal title, and so on, using special character sequences called escape sequences.
The bash shell has a variable called PROMPT_COMMAND which, if set, is evaluated before every prompt you print out (I believe zsh has something similar, in fact I think bash took the code from them). You can output escape sequences in PROMPT_COMMAND and it will set your title bar.
This is what I have in mine (Linux/bash):
USER=$(/usr/bin/id -un)
HOSTNAME=$(uname -n)
HOSTNAME=${HOSTNAME%%.*}
PROMPT_COMMAND='echo -ne "\e]0;$USER@${HOSTNAME}: $(pwd -P)\a"'
You can put this in your ~/.bashrc
There are a lot of customizations you can do with your terminal. I like bold in my prompt, to make it easier to see the end of my prompt. This makes it bold yellow, good against my default black background:
PS1="\[\e[33;1m\]\h:\$\[\e[0m\] "
Look around for Linux Prompt Customization, you'll find more HowTos than you'll know what to do with. Pick the one that you find easiest to read.
Note, this the only one that answers the question. – Erik Aronesty – 2014-11-19T18:19:01.857
Change
-e
to-en
if you want to avoid the extra blank line that is output by the echo command. – ADTC – 2016-06-06T08:06:47.533