By default the terminal windows will show the prompt with the hostname - which can be anything, assigned from DHCP.
To have it display the name as configured in the Sharing control panel, edit /etc/bashrc and replace PS1 with this:
PS1="[\u@:$(scutil --get ComputerName) \W]\\$ "