Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mpela81 opened this issue Nov 22, 2020 · 3 comments · Fixed by #8393
Closed

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

mpela81 opened this issue Nov 22, 2020 · 3 comments · Fixed by #8393
Assignees
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@mpela81
Copy link
Contributor

mpela81 commented Nov 22, 2020

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?

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 22, 2020
@Don-Vito
Copy link
Contributor

Don-Vito commented 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?

@DHowett
Copy link
Member

DHowett commented Nov 23, 2020

/cc @PankajBhojwani for TabHeaderControl change 😄

@DHowett DHowett added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 23, 2020
@DHowett DHowett added this to the Terminal v1.6 milestone Nov 23, 2020
@DHowett
Copy link
Member

DHowett commented Nov 23, 2020

@Don-Vito some discussion here about why it was not given control over the title: #8227 (comment)

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 DHowett changed the title Tab title stop changing dinamically after rename textbox is dismissed Tab title stop changing dynamically after rename textbox is dismissed Nov 23, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Nov 23, 2020
@ghost ghost added the In-PR This issue has a related PR label Nov 25, 2020
@ghost ghost closed this as completed in #8393 Nov 26, 2020
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Nov 26, 2020
ghost pushed a commit that referenced this issue Nov 26, 2020
Fix for #8365 

Adds a `_renameCancelled` bool that determines whether we raise the event for a title change. We do this because the lost focus handler for the rename box will be called _both_ when the renamer is dismissed by clicking somewhere else and by pressing enter/escape. So, the lost focus handler needs to conditionally raise the event. 
 
Closes #8365
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants