Setting terminal title is easy with echo -e "\e]0;some title\007". Works with pretty much every terminal program.
echo -e "\e]0;some title\007"
What I want is to set terminal title when some program starts - and restore old one when it finishes. Is this possible?