microsoft / microsoft/terminal

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

Open
#6,086 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Commandline Issue-Task Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the wt -p command-line path described in the reproduction steps, checking how profile names are matched when the supplied name is invalid or differs in case. Done means an invalid profile name produces a clear warning instead of silently selecting another profile, with behavior covered for the examples in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.