The title of an inactive terminal tab isn't updated
|Reported by:||heto||Owned by:||jackburton|
If a command-line application updates the label of a deselected tab, the change is lost completely. The tab keeps displaying the old label even after it's selected, and the same old title becomes the window title.
Reproducing: Run the following command in one tab:
sleep 2; echo -e '\E]2;New Title\a'
then immediately switch to another tab. You'll see that the tab label does not get updated. If you switch back to the original tab after the two seconds have passed, you'll see that the command has finished, but both the window title and the tab title are still the old ones.
I'm pretty sure the bug is caused because deselecting a tab causes that tab's target view to be detached from the window. This causes the TermView to unset the listener in its TerminalBuffer. Now when TermParse calls TerminalBuffer::SetTitle to set the title, it does not have a listener to deliver the message to.
I wonder if the whole message passing could be replaced with a function call in this case. If not, the view has to be kept listening to messages from its buffer even if it's detached from a window.