Some terminal programs, in particular Konsole supports "Remote title format" which allows you to specify title for remote tabs which includes placeholders like remote host. How does this work? Where does it get the remote host from, and how does it recognize the tab is holding a remote session?
It seems to work for ssh, but not for other remote shell or terminal clients, and neither does it work for screen sessions that connect to remote hosts. What's the protocol it uses to recognize the remote session?