SettingsUI: Add new ... StartingDirectory/Browse greyed out #13702

Closed
opened 2026-01-31 03:49:49 +00:00 by claunia · 15 comments
Owner

Originally created by @vefatica on GitHub (May 2, 2021).

Windows Terminal version (or Windows build number)

WindowsTerminal: 1.8.1092.0

Other Software

No response

Steps to reproduce

SettingsUI ... Add new ... uncheck "Use parent process directory"

Expected Behavior

Should be able to specify a starting directory.

Actual Behavior

The "Starting directory field and the "Browse" button are greyed out. That's also the case if you uncheck "Use parent process directory" for an existing profile with no starting directory specified.

image

Originally created by @vefatica on GitHub (May 2, 2021). ### Windows Terminal version (or Windows build number) WindowsTerminal: 1.8.1092.0 ### Other Software _No response_ ### Steps to reproduce SettingsUI ... Add new ... uncheck "Use parent process directory" ### Expected Behavior Should be able to specify a starting directory. ### Actual Behavior The "Starting directory field and the "Browse" button are greyed out. That's also the case if you uncheck "Use parent process directory" for an existing profile with no starting directory specified. ![image](https://user-images.githubusercontent.com/61856645/116819653-f1eb8c00-ab3e-11eb-9417-87ef9660c061.png)
Author
Owner

@PankajBhojwani commented on GitHub (May 3, 2021):

This sounds similar to #9847 (but that was fixed...), have you set the default directory under 'defaults' in your settings.json file?

@PankajBhojwani commented on GitHub (May 3, 2021): This sounds similar to #9847 (but that was fixed...), have you set the default directory under 'defaults' in your settings.json file?
Author
Owner

@vefatica commented on GitHub (May 3, 2021):

No, a default directory is not specified in 'defaults'.

@vefatica commented on GitHub (May 3, 2021): No, a default directory is **not** specified in 'defaults'.
Author
Owner

@PankajBhojwani commented on GitHub (May 3, 2021):

Hm I can't seem to repro this (I am on WT 1.9 though). Could you share what is in the 'profiles' section of your settings file?

@PankajBhojwani commented on GitHub (May 3, 2021): Hm I can't seem to repro this (I am on WT 1.9 though). Could you share what is in the 'profiles' section of your settings file?
Author
Owner

@vefatica commented on GitHub (May 3, 2021):

Sure (see below). Here's a bigger pic.

Interesting: Inthe JSON file, I don't see "commandline" (or a GUID) for the "Hidden" profile (shown in the pic).

image

"profiles": 
 {
     "defaults": 
     {
         "closeOnExit": "always",
         "colorScheme": "Vintage",
         "cursorColor": "#C0C0C0",
         "cursorHeight": 25,
         "cursorShape": "vintage",
         "fontFace": "Consolas",
         "fontSize": 13,
         "padding": "8,8,8,8",
         "tabColor": "#A0A0A0"
     },
     "list": 
     [
         {
             "commandline": "d:\\tc26\\tcc.exe",
             "guid": "{ecfa30ac-7c15-41c5-9f0f-886fff57c6ba}",
             "hidden": false,
             "icon": "d:\\tc26\\icon1.ico",
             "name": "TCC26",
             "startingDirectory": "v:\\"
         },
         {
             "commandline": "powershell.exe -NoLogo",
             "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
             "hidden": false,
             "icon": "U:\\Icons\\Powershell.png",
             "name": "PowerShell",
             "startingDirectory": "v:\\"
         },
         {
             "commandline": "cmd.exe",
             "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
             "hidden": false,
             "icon": "u:\\icons\\cmd.png",
             "name": "CMD",
             "startingDirectory": "v:\\"
         },
         {
             "commandline": "s:\\openssh\\ssh.exe vefatica@zz",
             "guid": "{c181173e-364d-4f45-ba0b-283730051162}",
             "hidden": false,
             "name": "ZZ-SSH"
         },
         {
             "commandline": "ssh vefatica@jj",
             "guid": "{e9e07f85-cbe3-46e5-af68-138a37ed8f4d}",
             "hidden": false,
             "name": "JJ-SSH"
         },
         {
             "commandline": "d:\\tc27\\tcc.exe",
             "guid": "{2345dfcd-6e9b-4897-b32d-40bb2d6c8039}",
             "hidden": false,
             "icon": "u:\\icons\\tccicon1.ico",
             "name": "TCC27",
             "startingDirectory": "v:\\"
         },
         {
             "commandline": "wsl.exe",
             "guid": "{4ba2fd44-db0a-44c1-95c2-ee4e55916fa1}",
             "hidden": false,
             "name": "**Ubuntu**"
         },
         {
             "closeOnExit": "never",
             "hidden": true,
             "name": "Hidden",
             "tabTitle": "Hidden"
         }
     ]
 }
@vefatica commented on GitHub (May 3, 2021): Sure (see below). Here's a bigger pic. Interesting: Inthe JSON file, I don't see "commandline" (or a GUID) for the "Hidden" profile (shown in the pic). ![image](https://user-images.githubusercontent.com/61856645/116839538-bda8b780-aba0-11eb-9e16-9d00e2519545.png) ``` "profiles": { "defaults": { "closeOnExit": "always", "colorScheme": "Vintage", "cursorColor": "#C0C0C0", "cursorHeight": 25, "cursorShape": "vintage", "fontFace": "Consolas", "fontSize": 13, "padding": "8,8,8,8", "tabColor": "#A0A0A0" }, "list": [ { "commandline": "d:\\tc26\\tcc.exe", "guid": "{ecfa30ac-7c15-41c5-9f0f-886fff57c6ba}", "hidden": false, "icon": "d:\\tc26\\icon1.ico", "name": "TCC26", "startingDirectory": "v:\\" }, { "commandline": "powershell.exe -NoLogo", "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "hidden": false, "icon": "U:\\Icons\\Powershell.png", "name": "PowerShell", "startingDirectory": "v:\\" }, { "commandline": "cmd.exe", "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "hidden": false, "icon": "u:\\icons\\cmd.png", "name": "CMD", "startingDirectory": "v:\\" }, { "commandline": "s:\\openssh\\ssh.exe vefatica@zz", "guid": "{c181173e-364d-4f45-ba0b-283730051162}", "hidden": false, "name": "ZZ-SSH" }, { "commandline": "ssh vefatica@jj", "guid": "{e9e07f85-cbe3-46e5-af68-138a37ed8f4d}", "hidden": false, "name": "JJ-SSH" }, { "commandline": "d:\\tc27\\tcc.exe", "guid": "{2345dfcd-6e9b-4897-b32d-40bb2d6c8039}", "hidden": false, "icon": "u:\\icons\\tccicon1.ico", "name": "TCC27", "startingDirectory": "v:\\" }, { "commandline": "wsl.exe", "guid": "{4ba2fd44-db0a-44c1-95c2-ee4e55916fa1}", "hidden": false, "name": "**Ubuntu**" }, { "closeOnExit": "never", "hidden": true, "name": "Hidden", "tabTitle": "Hidden" } ] } ```
Author
Owner

@vefatica commented on GitHub (May 3, 2021):

Really strange! I restarted WIndows Terminal and I still see a command line for "Hidden" in the UI and I don't see one in the JSON file.

image

{
"closeOnExit": "never",
"hidden": true,
"name": "Hidden",
"tabTitle": "Hidden"
}

@vefatica commented on GitHub (May 3, 2021): Really strange! I restarted WIndows Terminal and I still see a command line for "Hidden" in the UI and I don't see one in the JSON file. ![image](https://user-images.githubusercontent.com/61856645/116840246-2002b780-aba3-11eb-9a04-0b1e51c371aa.png) { "closeOnExit": "never", "hidden": true, "name": "Hidden", "tabTitle": "Hidden" }
Author
Owner

@PankajBhojwani commented on GitHub (May 3, 2021):

Really strange! I restarted WIndows Terminal and I still see a command line for "Hidden" in the UI and I don't see one in the JSON file.

That is expected! When a profile in the settings file does not explicitly define a commandline, we give it a 'default' commandline, which is cmd (that is technically an oversimplification of the way we handle settings but the gist is there).

@PankajBhojwani commented on GitHub (May 3, 2021): > Really strange! I restarted WIndows Terminal and I still see a command line for "Hidden" in the UI and I don't see one in the JSON file. That is expected! When a profile in the settings file does not explicitly define a commandline, we give it a 'default' commandline, which is cmd (that is technically an oversimplification of the way we handle settings but the gist is there).
Author
Owner

@vefatica commented on GitHub (May 3, 2021):

I typed "cmd.exe" in the "Command line" field of the UI. It still doesn't appear in the JSON file.

I changed it to c:\windows\system32\cmd.exe and it appeared in the JSON file.

I changed it back to "cmd.exe". Now it appears as "cmd.exe" in the JSON file.

And all the time, "Starting Directory" and "Browse" are greyed out.

@vefatica commented on GitHub (May 3, 2021): I typed "cmd.exe" in the "Command line" field of the UI. It still doesn't appear in the JSON file. I changed it to c:\windows\system32\cmd.exe and it appeared in the JSON file. I changed it back to "cmd.exe". Now it appears as "cmd.exe" in the JSON file. And all the time, "Starting Directory" and "Browse" are greyed out.
Author
Owner

@gokulyc commented on GitHub (May 3, 2021):

Windows Terminal Preview : Version: 1.8.1032.0

Unable to modify starting directory, everything else is working fine:

WindowsTerminal_tvcAzLUBSF

@gokulyc commented on GitHub (May 3, 2021): Windows Terminal Preview : Version: 1.8.1032.0 Unable to modify starting directory, everything else is working fine: ![WindowsTerminal_tvcAzLUBSF](https://user-images.githubusercontent.com/13468848/116852572-2f6d1980-ac12-11eb-9963-48f202db7246.png)
Author
Owner

@vefatica commented on GitHub (May 3, 2021):

Hmmm! I use "Add new". "Cmd.exe" is automatically placed in the UI field but not in the JSON file. In the UI, I erase it and enter "cmd.exe"; it still does not go into the JSON file. In the UI, I change it to "s:\cmd.exe"; now it's in the JSON file. In the UI, I change it back to "cmd.exe"; now it's in the JSON file (the same string that wasn't in the JSON file in the first place). Isn't that a bit goofy? Can't it simply always go into the JSON file?

And what about GUIDs? You don't get one with "Add new". Are GUIDs necessary, ever?

@vefatica commented on GitHub (May 3, 2021): Hmmm! I use "Add new". "Cmd.exe" is automatically placed in the UI field but not in the JSON file. In the UI, I erase it and enter "cmd.exe"; it still does not go into the JSON file. In the UI, I change it to "s:\cmd.exe"; now it's in the JSON file. In the UI, I change it back to "cmd.exe"; now it's in the JSON file (the same string that wasn't in the JSON file in the first place). Isn't that a bit goofy? Can't it simply always go into the JSON file? And what about GUIDs? You don't get one with "Add new". Are GUIDs necessary, ever?
Author
Owner

@htcfreek commented on GitHub (May 3, 2021):

Same for me:

  • no guid in json
  • can't change starting directory
@htcfreek commented on GitHub (May 3, 2021): Same for me: - no guid in json - can't change starting directory
Author
Owner

@htcfreek commented on GitHub (May 3, 2021):

Tipp: The workaround is editing json manually. Then the settings field for Directory is available.

@htcfreek commented on GitHub (May 3, 2021): Tipp: The workaround is editing json manually. Then the settings field for Directory is available.
Author
Owner

@htcfreek commented on GitHub (May 3, 2021):

@zadjii-msft
Why aren't all settings written to the json on saving/creating profiles. Same on auto-generated profiles.

In my json only the guid (only auto-generated), path, icon and hide setting are existing for the profiles.

@htcfreek commented on GitHub (May 3, 2021): @zadjii-msft Why aren't all settings written to the json on saving/creating profiles. Same on auto-generated profiles. In my json only the guid (only auto-generated), path, icon and hide setting are existing for the profiles.
Author
Owner

@zadjii-msft commented on GitHub (Jan 21, 2022):

Looks like this will be fixed in 1.13 when #11720 merges.
gh-10017-no-longer-repro

Actually this looks like it is fixed in Stable as well, 1.11.3471. With great likelyhood, even before that too.
gh-10017-no-longer-repro-002

@zadjii-msft commented on GitHub (Jan 21, 2022): Looks like this will be fixed in 1.13 when #11720 merges. ![gh-10017-no-longer-repro](https://user-images.githubusercontent.com/18356694/150557495-b856730d-ccc6-47b4-910e-1fd0151e1fe5.gif) Actually this looks like it is fixed in Stable as well, 1.11.3471. With great likelyhood, even before that too. ![gh-10017-no-longer-repro-002](https://user-images.githubusercontent.com/18356694/150557724-cfcfa8c5-ea7a-42ba-a6da-c4bf10570ce2.gif)
Author
Owner

@DHowett commented on GitHub (Jan 21, 2022):

@zadjii-msft Mike Griese FTE Why aren't all settings written to the json on saving/creating profiles. Same on auto-generated profiles.

In my json only the guid (only auto-generated), path, icon and hide setting are existing for the profiles.

I didn't realize this was not answered!

We only include the modified (or required for ID) settings in your JSON -- otherwise, an autogenerated profile would be generated one time and we could never fix bugs in the profile generator.

@DHowett commented on GitHub (Jan 21, 2022): > @zadjii-msft Mike Griese FTE Why aren't all settings written to the json on saving/creating profiles. Same on auto-generated profiles. > > In my json only the guid (only auto-generated), path, icon and hide setting are existing for the profiles. I didn't realize this was not answered! We only include the _modified_ (or required for ID) settings in your JSON -- otherwise, an autogenerated profile would be generated one time and we could never fix bugs in the profile generator.
Author
Owner

@0xJonasDev commented on GitHub (Apr 16, 2022):

Looks like this will be fixed in 1.13 when #11720 merges. gh-10017-no-longer-repro

Actually this looks like it is fixed in Stable as well, 1.11.3471. With great likelihood, even before that too. gh-10017-no-longer-repro-002

Forgive me if this has been addressed already somewhere else, but I realized that when Use parent process directory is checked, Command line is able to run ````testrun.batwhich is located in the parent process directory butIconis unable to accesstest_icon.ico which is also located in the parent process directory. Is there a reference (such as `%USERPROFILE% is to the home folder) to point to the parent process directory so that I can access the test_icon.ico file? Something along the lines of %PARENTDIRECTORY%\test_icon.ico or otherwise how do I deal with this? The intent here is to have wt dynamically locate whatever test_icon.ico file that is present in the current parent process directory.

image

@0xJonasDev commented on GitHub (Apr 16, 2022): > Looks like this will be fixed in 1.13 when #11720 merges. ![gh-10017-no-longer-repro](https://user-images.githubusercontent.com/18356694/150557495-b856730d-ccc6-47b4-910e-1fd0151e1fe5.gif) > > Actually this looks like it is fixed in Stable as well, 1.11.3471. With great likelihood, even before that too. ![gh-10017-no-longer-repro-002](https://user-images.githubusercontent.com/18356694/150557724-cfcfa8c5-ea7a-42ba-a6da-c4bf10570ce2.gif) Forgive me if this has been addressed already somewhere else, but I realized that when ```Use parent process directory``` is checked, ```Command line``` is able to run ````testrun.bat``` which is located in the parent process directory but ```Icon``` is unable to access ```test_icon.ico``` which is also located in the parent process directory. Is there a reference (such as `%USERPROFILE%``` is to the home folder) to point to the parent process directory so that I can access the ```test_icon.ico``` file? Something along the lines of ```%PARENTDIRECTORY%\test_icon.ico``` or otherwise how do I deal with this? The intent here is to have wt dynamically locate whatever ```test_icon.ico``` file that is present in the current parent process directory. ![image](https://user-images.githubusercontent.com/72827311/163658076-4740e35b-e721-4853-b572-53bc85564128.png)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13702