microsoft / microsoft/terminal
Display a warning when someone passes an invalid profile name on the `wt` commandline
Nobody has claimed this yet.
- 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
wt -p Windows PowerShell
Causes Windows Powershell to be loaded, but with Powershell (Core) as the profilewt -p Command Prompt
Following message is shown: [error 0x80070002 when launching `Prompt'] (Is using the Powershell (Core) profile but the tab name is empty)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:
- Commands should only accept the ones defined in the documentation, (e.g.
new-tab,split-pane,focus-tab) - 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?
- (imo) If a direct (case insensitive) profile match is found do launch that, instead of the default. (i.e.
wt -p ubuntuis the same aswt -p Ubuntu)
Actual behavior
In steps to reproduce, above.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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