Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vefatica opened this issue May 2, 2021 · 15 comments · Fixed by #11720
Closed

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

vefatica opened this issue May 2, 2021 · 15 comments · Fixed by #11720
Labels
Area-Settings UI Anything specific to the SUI Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Available It's available in an Insiders build or a release

Comments

@vefatica
Copy link

vefatica commented 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

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels May 2, 2021
@PankajBhojwani
Copy link
Contributor

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

@vefatica
Copy link
Author

vefatica commented May 3, 2021

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

@PankajBhojwani
Copy link
Contributor

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?

@vefatica
Copy link
Author

vefatica commented 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
Copy link
Author

vefatica commented 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"
}

@PankajBhojwani
Copy link
Contributor

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).

@vefatica
Copy link
Author

vefatica commented 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.

@gokulyc
Copy link

gokulyc commented May 3, 2021

Windows Terminal Preview : Version: 1.8.1032.0

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

WindowsTerminal_tvcAzLUBSF

@vefatica
Copy link
Author

vefatica commented 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?

@htcfreek
Copy link

htcfreek commented May 3, 2021

Same for me:

  • no guid in json
  • can't change starting directory

@htcfreek
Copy link

htcfreek commented May 3, 2021

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

@htcfreek
Copy link

htcfreek commented 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.

@zadjii-msft zadjii-msft added the Area-Settings UI Anything specific to the SUI label May 13, 2021
@zadjii-msft zadjii-msft added Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Sep 18, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Sep 18, 2021
@zadjii-msft zadjii-msft added this to the Terminal v2.0 milestone Sep 18, 2021
@zadjii-msft zadjii-msft added Needs-Tag-Fix Doesn't match tag requirements and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Sep 18, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Sep 18, 2021
@zadjii-msft zadjii-msft modified the milestones: Terminal v2.0, 22H2 Jan 4, 2022
@zadjii-msft zadjii-msft linked a pull request Jan 21, 2022 that will close this issue
9 tasks
@zadjii-msft zadjii-msft modified the milestones: 22H2, Terminal v1.11 Jan 21, 2022
@zadjii-msft
Copy link
Member

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

@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Jan 21, 2022
@zadjii-msft zadjii-msft added Resolution-Fix-Available It's available in an Insiders build or a release and removed Needs-Tag-Fix Doesn't match tag requirements labels Jan 21, 2022
@DHowett
Copy link
Member

DHowett commented 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.

@0xJonasDev
Copy link

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 butIcon``` 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings UI Anything specific to the SUI Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Available It's available in an Insiders build or a release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants