Custom default profile not loaded correctly when terminal window opened via cmd #20878

Closed
opened 2026-01-31 07:26:36 +00:00 by claunia · 3 comments
Owner

Originally created by @flriancu on GitHub (Nov 23, 2023).

Windows Terminal version

1.18.2822.0

Windows build number

10.0.22621.2715

Other Software

miniforge installed via winget install CondaForge.Miniforge3

Steps to reproduce

  • install miniforge via winget install CondaForge.Miniforge3
  • open the start menu, then a miniforge prompt, then run where python and make a note of the parent directory of the miniforge Python; in my case it's %localappdata%\miniforge3
  • open windows terminal's settings.json file, and add the following snippet at the beginning of profiles.list; if needed, change the location of Python depending on where it was installed by winget
                {
                    "commandline": "powershell -ExecutionPolicy ByPass -NoExit -Command \"& '%localappdata%\\miniforge3\\shell\\condabin\\conda-hook.ps1' ; conda activate '%localappdata%\\miniforge3'\"",
                    "guid": "{ea174bc0-cf98-45f4-a70b-21fbff2bbfc6}",
                    "hidden": false,
                    "icon": "%localappdata%\\miniforge3\\Menu\\console_shortcut.ico",
                    "name": "Miniforge PowerShell"
                },
                {
                    "commandline": "cmd.exe /K %localappdata%\\miniforge3\\Scripts\\activate.bat %localappdata%\\miniforge3",
                    "guid": "{f77912a4-f18f-4022-a6fe-a28e9c46da90}",
                    "hidden": false,
                    "icon": "%localappdata%\\miniforge3\\Menu\\console_shortcut.ico",
                    "name": "Miniforge"
                },
    
  • save the settings.json file
  • go to settings -> startup -> default profile and choose Miniforge
  • go to settings -> startup -> default terminal application and choose Windows Terminal
  • close the terminal

Expected Behavior

  • expected and actual behavior: when opening a terminal window via wt, the default profile is loaded:
    image
  • expected behavior: when opening a terminal window via cmd, the default profile is loaded

Actual Behavior

  • when opening a terminal window via cmd, the following happens:
    image
    I'm not sure whether the default profile should be "Miniforge" or "Command Prompt" in this case.
Originally created by @flriancu on GitHub (Nov 23, 2023). ### Windows Terminal version 1.18.2822.0 ### Windows build number 10.0.22621.2715 ### Other Software miniforge installed via `winget install CondaForge.Miniforge3` ### Steps to reproduce - install miniforge via `winget install CondaForge.Miniforge3` - open the start menu, then a miniforge prompt, then run `where python` and make a note of the parent directory of the miniforge Python; in my case it's `%localappdata%\miniforge3` - open windows terminal's settings.json file, and add the following snippet at the beginning of `profiles.list`; if needed, change the location of Python depending on where it was installed by winget ```json { "commandline": "powershell -ExecutionPolicy ByPass -NoExit -Command \"& '%localappdata%\\miniforge3\\shell\\condabin\\conda-hook.ps1' ; conda activate '%localappdata%\\miniforge3'\"", "guid": "{ea174bc0-cf98-45f4-a70b-21fbff2bbfc6}", "hidden": false, "icon": "%localappdata%\\miniforge3\\Menu\\console_shortcut.ico", "name": "Miniforge PowerShell" }, { "commandline": "cmd.exe /K %localappdata%\\miniforge3\\Scripts\\activate.bat %localappdata%\\miniforge3", "guid": "{f77912a4-f18f-4022-a6fe-a28e9c46da90}", "hidden": false, "icon": "%localappdata%\\miniforge3\\Menu\\console_shortcut.ico", "name": "Miniforge" }, ``` - save the settings.json file - go to settings -> startup -> default profile and choose `Miniforge` - go to settings -> startup -> default terminal application and choose `Windows Terminal` - close the terminal ### Expected Behavior - expected and actual behavior: when opening a terminal window via `wt`, the default profile is loaded: ![image](https://github.com/microsoft/terminal/assets/8483893/f99607f5-99e5-49d9-9023-1d713c864d09) - expected behavior: when opening a terminal window via `cmd`, the default profile is loaded ### Actual Behavior - when opening a terminal window via `cmd`, the following happens: ![image](https://github.com/microsoft/terminal/assets/8483893/12a3b7ae-54e2-42f3-bb03-3128f979f6be) I'm not sure whether the default profile should be "Miniforge" or "Command Prompt" in this case.
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 07:26:37 +00:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 23, 2023):

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@github-actions[bot] commented on GitHub (Nov 23, 2023): Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! ### Closed similar issues: - [Opening Windows Terminal by default doesn't pick the right profile (#10228)](https://github.com/microsoft/terminal/issues/10228), similarity score: 0.84 - [When default profile is set to Command Prompt, "Open in Windows Terminal" uses cmd.exe in current folder (#12126)](https://github.com/microsoft/terminal/issues/12126), similarity score: 0.82 - [Default profile should be powershell, rather than cmd (#431)](https://github.com/microsoft/terminal/issues/431), similarity score: 0.81 > Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Author
Owner

@lhecker commented on GitHub (Nov 27, 2023):

Unless I misunderstood your issue description, I believe that this is intentional behavior. cmd is not an alias for wt and running cmd from Win+R executes exactly the given command. When Windows Terminal then opens to display the contents of your command it doesn't have any influence anymore over what that command does. Try running

cmd.exe /K %localappdata%\\miniforge3\\Scripts\\activate.bat %localappdata%\\miniforge3

from Win+R instead. That should match with your custom profile since the command lines match.

@lhecker commented on GitHub (Nov 27, 2023): Unless I misunderstood your issue description, I believe that this is intentional behavior. `cmd` is not an alias for `wt` and running `cmd` from Win+R executes exactly the given command. When Windows Terminal then opens to display the contents of your command it doesn't have any influence anymore over what that command does. Try running ``` cmd.exe /K %localappdata%\\miniforge3\\Scripts\\activate.bat %localappdata%\\miniforge3 ``` from Win+R instead. That should match with your custom profile since the command lines match.
Author
Owner

@flriancu commented on GitHub (Dec 3, 2023):

There was a major misunderstanding on my part. I was under the impression that the profile listed in bold font in the drop-down menu was the profile of the active tab. Of course, it actually refers to the default profile 😄 Thanks for your patience, I'll close the issue.

@flriancu commented on GitHub (Dec 3, 2023): There was a major misunderstanding on my part. I was under the impression that the profile listed in bold font in the drop-down menu was the profile of the active tab. Of course, it actually refers to the default profile 😄 Thanks for your patience, I'll close the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20878