Setting terminal title is easy with echo -e "\e]0;some title\007"
. Works with pretty much every terminal program.
What I want is to set terminal title when some program starts - and restore old one when it finishes. Is this possible?
On xterm, the terminal control sequences 22 and 23 work fine, as in
#!/bin/sh
/bin/echo -ne '\033[22;0t' # Save title on stack
/bin/echo -ne "\033]0;$(date)\007"
sleep 1
/bin/echo -ne '\033[23;0t' # Restore title from stack
It looks like this isn't supported in the Mac OS X Terminal.App though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With