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

Enable tab renaming at runtime from the UI #5775

Merged
10 commits merged into from
May 28, 2020
Merged

Conversation

zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented May 6, 2020

Summary of the Pull Request

Adds support for setting, from the UI, a runtime override for the tab title text. The user can use this to effectively "rename" a tab.

If set, the tab will always use the runtime override string. If the user has multiple panes with different titles in a pane, then the tab's override text will be used regardless of which pane was focused when the tab was renamed.

The override text can be removed by just deleting the entire contents of the box. Then, the tab will revert to using the terminal's usual title.

References

PR Checklist

TODO

  • Tab::SetTabText might be able to be greatly simplified/removed?
  • I'm pretty sure if they set an override title, we won't bubble that up to set the window title.
  • I'm unsure how this behaves when the terminal's title changes while the TextBox is visible. I don't think it should change the current contents of the box, but it might currently.
  • for discussion: If the user doesn't actually change the text of the tab, then we probably shouldn't set the override text, right?
    • EX: if they open the box and the text is "cmd", and immediately hit enter, then run title foo, should the text change to "foo" or stay "cmd"?

Detailed Description of the Pull Request / Additional comments

image
image
image
image
image
image
image
image

@ghost ghost added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. labels May 6, 2020
@carlos-zamora
Copy link
Member

  • for discussion: If the user doesn't actually change the text of the tab, then we probably shouldn't set the override text, right?

    • EX: if they open the box and the text is "cmd", and immediately hit enter, then run title foo, should the text change to "foo" or stay "cmd"?

In my mind...

  • Enter --> confirm that this is the title I want
  • ESC --> don't set the title

That said, consider the following scenario...

  1. rename title with mouse to "TITLE A"(this feature)
  2. use terminal for prolonged period of time
  3. begin renaming title with mouse (this feature)
  4. press ESC

At this point, the title is "TITLE A". If I run title FOO in cmd, I'd argue the title is changed to FOO (assuming suppressApplicationTitle is false), because the user is now opting-in to not having set the title.

src/cascadia/TerminalApp/Tab.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Tab.cpp Outdated Show resolved Hide resolved
Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
@zadjii-msft
Copy link
Member Author

Okay so the way I saw it was:

  • Enter --> confirm that this is the title I want
  • ESC --> don't change the title.
    So if I set it to "foo", then go to edit it, and hit ESC, I want to leave it as "foo"

Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still disagree with you on the ESC thing, but I'd like to download the branch and try it out. So I'm not gonna block. Curious what other team members think about that behavior. @DHowett-MSFT Any chance we could get this in the next team selfhost build? 😁

src/cascadia/TerminalApp/Tab.cpp Show resolved Hide resolved
src/cascadia/TerminalApp/Tab.cpp Show resolved Hide resolved
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love it. More xaml files for UI would be good but not required.

Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk why my machine won't let me actually download the branch and try it. But might as well put it in master and make changes after we get everybody testing it out.

@zadjii-msft
Copy link
Member Author

@msftbot merge this bad boy in like 5 minutes

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label May 28, 2020
@ghost
Copy link

ghost commented May 28, 2020

Hello @zadjii-msft!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Thu, 28 May 2020 21:05:49 GMT, which is in 5 minutes

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost ghost merged commit f17b6c7 into master May 28, 2020
@ghost ghost deleted the dev/migrie/f/1079-rename-tab branch May 28, 2020 21:06
@DHowett
Copy link
Member

DHowett commented May 28, 2020

LOL.

@fanlix
Copy link

fanlix commented May 29, 2020

about the discuss

please trust the user, and make it as simple as possible
forget the ESC thing, just Enter enough.

  • any text user entered , is the title should be
  • except : when user enter empty (by delete all charactors), change back to default title.
  • edit some text, no Enter, change mouse focus elsewhere
    • edit box should be closed, title no change.

@BartXZX
Copy link

BartXZX commented May 29, 2020

Hi guys, I'm really excited to start using this feature!

I couldn't really find anything related to it, so I am asking here. Would it be possible to bind a shortcut key to the rename action, so that it open up the rename box once pressed?

I quite often rename my windows once I repurposed them and would love not to have to take my hands of the keyboard. Let me know if I should create an issue for it.

@ghost
Copy link

ghost commented Jun 18, 2020

🎉Windows Terminal Preview v1.1.1671.0 has been released which incorporates this pull request.:tada:

Handy links:

@ghost ghost mentioned this pull request Jun 18, 2020
@dhavalhirdhav
Copy link

Wow.. Congratulations team :D Apologies, I did not participate in #1079 after opening it up.. but I was following it closely. It gave me a great insights into how Microsoft plans features.. I have always trusted Microsoft.. but this process has given me kind of assurance that features are thought in details.. and with a quality in mind.. feature small as this one how it can be turned into a great feature is what this thread really teaches.

This pull request 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 AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to rename Tab title at runtime
8 participants