Opened 10 years ago

Last modified 7 years ago

#3753 new bug

The title of an inactive terminal tab isn't updated

Reported by: heto Owned by: jackburton
Priority: normal Milestone: R1
Component: Applications/Terminal Version: R1/pre-alpha1
Keywords: gci2011 Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All


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.

Change History (3)

comment:1 Changed 10 years ago by stippi

Actually, I think this whole detaching/attaching of views which BTabView does is a design flaw of BeOS which we inherited (and it shows in exactly these situations). Unfortunately some applications may actually depend on it. But what we could do is change the behavior when layout-management is used. In that case we should use hiding/showing of the views. (Which may actually be the case already, now that I think of it...) In that case, the solution to this particular problem would be to convert Terminal to use layout-management.

comment:2 Changed 10 years ago by leavengood

I've been researching tabs lately for the browser project and I looked over the BTabView code, and it indeed will stop detaching views if a BCardLayout is present. It just delegates to the card layout to hide and show the views as the tabs are selected.

So as Stephan says switching to using layout management (well at least using a card layout) would probably fix this issue. Of course the terminal GUI does some off-by-one manual layout tricks to make the scrollbar look better and I am not sure how that would be affected by using layout management. Guess we will see if and when someone tries.

comment:3 Changed 7 years ago by pepol

Keywords: gci2011 added

The problem was checked during GCI 2011. Terminal still haves the same way, as provided in description on hrev43238. I have also checked if there is nothing wrong with example command itself, but it works fine, if the tab is focused during execution.

Note: See TracTickets for help on using tickets.