Tab title stop changing dynamically after rename textbox is dismissed #11540

Closed
opened 2026-01-31 02:50:32 +00:00 by claunia · 3 comments
Owner

Originally created by @mpela81 on GitHub (Nov 22, 2020).

Originally assigned to: @PankajBhojwani on GitHub.

Environment

Windows Terminal version (if applicable): current main branch

Steps to reproduce

  • Open WSL in a new tab (the tab title reflects the current working dir)
  • Double-click tab header to rename
  • Dismiss the rename text box (e.g. press Esc)
  • Change the current working directory in WSL

Expected behavior

The tab title reflects the new current working directory

Actual behavior

The tab title does not change, as if it was overridden by the rename operation

Maybe related to changes in #8227?

Originally created by @mpela81 on GitHub (Nov 22, 2020). Originally assigned to: @PankajBhojwani on GitHub. # Environment ```none Windows Terminal version (if applicable): current main branch ``` # Steps to reproduce - Open WSL in a new tab (the tab title reflects the current working dir) - Double-click tab header to rename - Dismiss the rename text box (e.g. press Esc) - Change the current working directory in WSL # Expected behavior The tab title reflects the new current working directory # Actual behavior The tab title does not change, as if it was overridden by the rename operation Maybe related to changes in #8227?
Author
Owner

@Don-Vito commented on GitHub (Nov 22, 2020):

@mpela81 - I believe it is related.

  • Once you click escape you still call _CloseRenameBox
  • _CloseRenameBox calls _TitleChangeRequestedHandlers (although with the original value)
  • That invokes our Terminal Tab registration for TitleChangeRequested (in ctor)
  • This lambda calls TerminalTab::SetTabText that invokes UpdateTitle,
  • UpdateTitle calls SetTabText that sets _runtimeTabText,
  • _runtimeTabText is always preferred relatively to the value that TermControl holds

We definitely should not report update of title if rename was canceled.

@PankajBhojwani -

  • I really liked you change in general
  • Please let me know if you need assistance with this small defect (although this is a one-liner)
  • I've noticed that TabHeaderControl only reports title update, but never updates Title by its own.. so it kinda depends on someone else setting the title. Given it is now a standalone element, wouldn't we expect it to be more self-contained?
@Don-Vito commented on GitHub (Nov 22, 2020): @mpela81 - I believe it is related. * Once you click escape you still call _CloseRenameBox * _CloseRenameBox calls _TitleChangeRequestedHandlers (although with the original value) * That invokes our Terminal Tab registration for TitleChangeRequested (in ctor) * This lambda calls TerminalTab::SetTabText that invokes UpdateTitle, * UpdateTitle calls SetTabText that sets _runtimeTabText, * _runtimeTabText is always preferred relatively to the value that TermControl holds We definitely should not report update of title if rename was canceled. @PankajBhojwani - * I really liked you change in general * Please let me know if you need assistance with this small defect (although this is a one-liner) * I've noticed that TabHeaderControl only reports title update, but never updates Title by its own.. so it kinda depends on someone else setting the title. Given it is now a standalone element, wouldn't we expect it to be more self-contained?
Author
Owner

@DHowett commented on GitHub (Nov 23, 2020):

/cc @PankajBhojwani for TabHeaderControl change 😄

@DHowett commented on GitHub (Nov 23, 2020): /cc @PankajBhojwani for TabHeaderControl change :smile:
Author
Owner

@DHowett commented on GitHub (Nov 23, 2020):

@Don-Vito some discussion here about why it was not given control over the title: https://github.com/microsoft/terminal/pull/8227#discussion_r524407402

The whole comment chain is pretty good.

It seems very similar to TabView's TabCloseRequested: the view is not the datamodel, it should not be allowed to be the datamodel, it should only communicate desired state changes to its keepers. 😄

@DHowett commented on GitHub (Nov 23, 2020): @Don-Vito some discussion here about why it was not given control over the title: https://github.com/microsoft/terminal/pull/8227#discussion_r524407402 The whole comment chain is pretty good. It seems very similar to TabView's TabCloseRequested: the view is not the datamodel, it should not be allowed to be the datamodel, it should only communicate desired state changes to its keepers. :smile:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11540