When there's no profile or title, invent a title from the commandline (#10998)
This supports a future world where we give commandline-only invocations their own tabs. It was easier to promote the commandline to a title at the time of argument parsing, rather than later, but I am happy to change this if anyone disagrees.
This commit is contained in:
parent
d07546a6fe
commit
f681d3a1c1
|
@ -603,6 +603,13 @@ NewTerminalArgs AppCommandlineArgs::_getNewTerminalArgs(AppCommandlineArgs::NewT
|
|||
args.Profile(winrt::to_hstring(_profileName));
|
||||
}
|
||||
|
||||
if (!*subcommand.profileNameOption && !_commandline.empty())
|
||||
{
|
||||
// If there's no profile, but there IS a command line, set the tab title to the first part of the command
|
||||
// This will ensure that the tab we spawn has a name (since it didn't get one from its profile!)
|
||||
args.TabTitle(winrt::to_hstring(til::at(_commandline, 0)));
|
||||
}
|
||||
|
||||
if (*subcommand.startingDirectoryOption)
|
||||
{
|
||||
args.StartingDirectory(winrt::to_hstring(_startingDirectory));
|
||||
|
|
Loading…
Reference in a new issue