-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Add support for setting tabColor on the command line #8102
Conversation
@zadjii-msft - our CI is impossible 😄 All tests past locally but are flaky as hell when running in pipelines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are kinda just nits, but I do think the Windows::UI::Color
thing would be slightly cleaner.
Otherwise, great job here!
@zadjii-msft - fixed, please re-review 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, this is the stuff. Great work!
Bump - so I can advance on week-end |
So it's interesting. A profile can set a tabColor, which means that panes technically have one. I'll need @zadjii-msft to weigh in. It might boil down to "it should be like a title -- the focused pane wins -- we just didn't do it like that" |
@DHowett - cool. I will try to implement this approach as well and then we can choose 😊 |
@DHowett , @zadjii-msft - changed the implementation to set the color on the pane level.
Hence I added a StartingTitle to TermControl, I was not sure if I should add it to TermControl or Terminal itself (I will probably move it to Terminal in a separate PR, and merge to here if required) |
I decided to move everything to Terminal, we'll see if it was a good decision 😄 |
@zadjii-msft - I added the starting tab color to be a property of the Terminal. Consequently, when a new tab is created the color is set on the first pane. But if we split the tab the color is not set on the second pane. We could say that the color will be applied for all panes of the tab, but this gets complicated, as the color can be also specified on the second pane as well. Which will require us to resolve what color is preferable. This is possible, but I am not sure if we want to get there product-wise. WDYT? |
Updated the docs. Thanks! |
Bumping this as it works pretty cool 😊 |
Okay, sorry for the delay reviewing this. You're churning out so many dang PRs, it's hard to keep up 😄 I've played with the branch as it is this morning, and I like how it feels. And it feels like what I originally described in #8075. Plus, being resilient to a settings reload is a clever solution. I'll sanity check the code now, but it definitely feels 👌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yea I already reviewed 90% of this. This looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I'm ok with this. I like the feature. I don't like the TabColor
vs StartingTabColor
thing, but I'll just have to live with it since it seems to be the best approach tbh.
GETSET_PROPERTY(Windows::Foundation::IReference<uint32_t>, TabColor, nullptr); | ||
GETSET_PROPERTY(Windows::Foundation::IReference<uint32_t>, StartingTabColor, nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DHowett or @zadjii-msft:
Should we have a comment here or somewhere describing the difference between these two properties? I understand that we need StartingTabColor
, but I have a feeling it'll be confusing to have both down the road.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@carlos-zamora - I totally agree with you that it is both confusing and error-prone. Instead I would like to:
- Introduce "ITerminalCreationParams" and move this property there.
- Pass them upon construction
However this will require changing the Terminal interface, that I felt is somewhat above my paygrade at this stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. We'll need to get the TerminalSettings back into check because sometimes we use it to communicate app-only state, but I'm happy with this for now.
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
* Add a tabColor parameter to the `new-tab` and `split-panes` command * Add --tabColor to the command line, to allow bootstrapping with tabs of different colors Add another field to NewTerminalArgs. Use this field to set StartingTabColor in Terminal. This color gets overridden by the color defined by the profile / VT, however can be overridden with the color picker. Since the color is the property of the Terminal, when defined for the tab this color is associated only with the first pane/terminal of the tab. Additional panes will not inherit this color (to prevent advanced resolution, where we need to resolve between the inherited color and the one specified for the pane). ## Validation Steps Performed * UT for parameters parsing * Running system with several tabs of different colors. * Adding custom actions with colors * Performing operations like split pane, duplicate and so on Closes microsoft#8075
new-tab
andsplit-panes
commandof different colors
Add another field to NewTerminalArgs. Use this field to set
StartingTabColor in Terminal. This color gets overridden by the color
defined by the profile / VT, however can be overridden with the color
picker.
Since the color is the property of the Terminal, when defined for the
tab this color is associated only with the first pane/terminal of the
tab. Additional panes will not inherit this color (to prevent advanced
resolution, where we need to resolve between the inherited color and the
one specified for the pane).
Validation Steps Performed
Closes #8075