Skip to content

Display a warning when someone passes an invalid profile name on the wt commandline #6086

@thlac

Description

@thlac

Environment

Windows build number: 10.0.19041.264
Windows Terminal version (if applicable): 1.0.1401.0

Profiles:
Windows Powershell
Command Prompt
PowerShell
PowerShell 7 Preview
Ubuntu
Azure Cloud Shell

Config: settings.txt

Steps to reproduce

  1. wt -p Windows PowerShell
    Causes Windows Powershell to be loaded, but with Powershell (Core) as the profile
  2. wt -p Command Prompt
    Following message is shown: [error 0x80070002 when launching `Prompt'] (Is using the Powershell (Core) profile but the tab name is empty)
  3. wt -p ubuntu
    Launches Powershell (Core)

Expected behavior

Less confusing behaviour, from what I have observed it seems like, on my system at least, the Powershell (Core) profile is considered a default of sorts, so if it doesn't find a direct match it just opens that. It also seems that the second argument seems to be passed as an argument to the profile, not entirely sure if that's right way to describe it, as wt -p Windows Get-Date results in the same error as the Command Prompt example instead of executing Get-Date.

So I think ways of adressing that would be:

  1. Commands should only accept the ones defined in the documentation, (e.g. new-tab, split-pane, focus-tab)
  2. If a direct (case insensitive) profile match isn't found, is it possible to launch the default profile while displaying to the user that the selected profile wasn't found?
  3. (imo) If a direct (case insensitive) profile match is found do launch that, instead of the default. (i.e. wt -p ubuntu is the same as wt -p Ubuntu)

Actual behavior

In steps to reproduce, above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Commandlinewt.exe's commandline argumentsIssue-TaskIt's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions