Skip to content

Allow configuring suppressApplicationTitle in new tab/pane/window commands#9392

Merged
3 commits merged intomicrosoft:mainfrom
Don-Vito:9345-suppress-application-title
Mar 8, 2021
Merged

Allow configuring suppressApplicationTitle in new tab/pane/window commands#9392
3 commits merged intomicrosoft:mainfrom
Don-Vito:9345-suppress-application-title

Conversation

@Don-Vito
Copy link
Contributor

@Don-Vito Don-Vito commented Mar 5, 2021

PR Checklist

Detailed Description of the Pull Request / Additional comments

Introduce optional suppressApplicationTitle in to NewTerminalArgs.
When set (either to true or false) overrides profile configuration.

Introduce --suppressApplicationTitle flag to command line arguments.
When provided for sub=command,
sets the value in the relevant NewTerminalArgs to true

@ghost ghost added Area-Commandline wt.exe's commandline arguments Area-Settings Issues related to settings and customizability, for console or terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. labels Mar 5, 2021
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.

Awesome! Great work (as always haha)!

_startingTabColor,
RS_A(L"CmdTabColorArgDesc"));

subcommand.suppressApplicationTitleOption = subcommand.subcommand->add_flag(
Copy link
Member

Choose a reason for hiding this comment

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

Should we add some kind of shorthand version of this? suppressApplicationTitle is one of the longest named settings we have, I think haha.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure, I usually write those once (in startupActions 😛 )

Copy link
Member

Choose a reason for hiding this comment

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

Yea, I say let's leave it for now, and if someone really wants a single-character flag for it in the future, and has a good idea, then we can address it then.

}
if (newTerminalArgs.SuppressApplicationTitle())
{
settings.SuppressApplicationTitle(newTerminalArgs.SuppressApplicationTitle().Value());
Copy link
Member

Choose a reason for hiding this comment

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

This is totally off-topic to this PR, but something I wanted to discuss out loud. Since we get the profile and generate a TerminalSettings from it, that means we get base layer (or profiles.defaults) applied properly. Maybe we should emphasize this in the docs? I feel like most people that use this setting want to enable it on every profile, but that's just a gut feeling.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I am not sure.. I usually use two types of tabs:

  • General purpose ones, where I do change folders and stuff - I want the title to change
  • Dedicated ones (e.g., git bash in terminal folder) that I don't - I want the title to remain Terminal Dev.

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

Okay so my only concern before approving this:

right now you can pass --suppressApplicationTitle, and that'll set NewTerminalArgs::suppressApplicationTitle to true. Do we need something like --useApplicationTitle that'll force NewTerminalArgs::suppressApplicationTitle to false?

@Don-Vito
Copy link
Contributor Author

Don-Vito commented Mar 8, 2021

Okay so my only concern before approving this:

right now you can pass --suppressApplicationTitle, and that'll set NewTerminalArgs::suppressApplicationTitle to true. Do we need something like --useApplicationTitle that'll force NewTerminalArgs::suppressApplicationTitle to false?

The standard for CLI11 is !--suppressApplicationTitle, I can make it work I guess. WDYT?
Ignore it.
I will add it :)

@Don-Vito Don-Vito requested a review from zadjii-msft March 8, 2021 15:04
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

wow I did not know about that in CLI11. TIL!

from the docs for future me:

Flag options specified through the add_flag* functions allow a syntax for the option names to default particular options to a false value or any other value if some flags are passed. For example:

app.add_flag("--flag,!--no-flag",result,"help for flag");

specifies that if --flag is passed on the command line result will be true or contain a value of 1. If --no-flag is
passed result will contain false or -1 if result is a signed integer type, or 0 if it is an unsigned type. An
alternative form of the syntax is more explicit: "--flag,--no-flag{false}"; this is equivalent to the previous
example. This also works for short form options "-f,!-n" or "-f,-n{false}". If variable_to_bind_to is anything but an integer value the
default behavior is to take the last value given, while if variable_to_bind_to is an integer type the behavior will be to sum
all the given arguments and return the result.

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Mar 8, 2021
@ghost
Copy link

ghost commented Mar 8, 2021

Hello @zadjii-msft!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

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 (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit c6a3171 into microsoft:main Mar 8, 2021
@ghost
Copy link

ghost commented Apr 14, 2021

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

Handy links:

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-Commandline wt.exe's commandline arguments Area-Settings Issues related to settings and customizability, for console or terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants