Add functionality to settings Open JSON file entry to open the settings.json parent folder in Explorer #16650

Open
opened 2026-01-31 05:18:29 +00:00 by claunia · 13 comments
Owner

Originally created by @darkred on GitHub (Feb 4, 2022).

Description of the new feature/enhancement

(this is a follow up to this issue #1460)

I have Windows Terminal latest stable, v1.12.10334.0 , on win11.

Currently, in the dropdown menu | 'Settings', there's an Open JSON file entry, clicking which opens the settings.json file only if the user has associated the .json file type with an installed editor, otherwise it shows the "Do you want to open this file?" windows dialog .

screen capture:

If you close the dialog, in order to manage to open the settings.json file manually, you'll have to look in the project wiki FAQ to find its location/path - there's no related info shown inside the app.

So, my suggestion is add functionality to "Open JSON file" settings entry to open the settings.json parent folder in Explorer.

Proposed technical implementation details (optional)

In details, my suggestion is, when clicking the Open JSON file entry, instead of attempting to open settings.json with the associated editor, to display a menu with two entries:

  • Open settings.json with associated editor
  • Open parent folder of settings.json in Explorer (in order to be able to open it manually).

 
Or, alternatively/more simply, keep the current behavior (=attempt to open the file with the associated editor when leftclicking the "Open JSON file" entry), but when rightclicking it, to open its parent folder in file explorer (and update the entry tooltip respectively).

Originally created by @darkred on GitHub (Feb 4, 2022). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> *(this is a follow up to this issue #1460)* I have Windows Terminal latest stable, v1.12.10334.0 , on win11. Currently, in the dropdown menu | 'Settings', there's an `Open JSON file` entry, clicking which opens the settings.json file only if the user has associated the .json file type with an installed editor, otherwise it shows the "Do you want to open this file?" windows dialog . <details> <summary>screen capture: </summary> ![](https://user-images.githubusercontent.com/723651/152614540-bc2294dc-597e-4f37-a8a9-c0a9589e5197.gif) </details> If you close the dialog, in order to manage to open the settings.json file manually, you'll have to look in the project [wiki FAQ](https://github.com/microsoft/terminal/wiki/Frequently-Asked-Questions-(FAQ)#where-can-i-find-the-settings-file) to find its location/path - there's no related info shown inside the app. So, my suggestion is add functionality to "Open JSON file" settings entry to open the settings.json parent folder in Explorer. # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. --> In details, my suggestion is, when clicking the `Open JSON file` entry, instead of attempting to open settings.json with the associated editor, to display a menu with two entries: - `Open settings.json with associated editor` - `Open parent folder of settings.json in Explorer` (in order to be able to open it manually). &nbsp; Or, alternatively/more simply, keep the current behavior (=attempt to open the file with the associated editor when leftclicking the "Open JSON file" entry), but when *rightclicking* it, to open its parent folder in file explorer (and update the entry `tooltip` respectively).
Author
Owner

@zadjii-msft commented on GitHub (Feb 8, 2022):

This is a clever idea.

Other ideas to build on this:

We change the button at the bottom of the nav view to a "More options" button with a flyout, and in there, stick:

  • Open JSON file
  • Open settings folder
  • Reset to default settings (#947)
@zadjii-msft commented on GitHub (Feb 8, 2022): This is a clever idea. Other ideas to build on this: We change the button at the bottom of the nav view to a "More options" button with a flyout, and in there, stick: * Open JSON file * Open settings folder * Reset to default settings (#947)
Author
Owner

@Swinkid commented on GitHub (Mar 16, 2023):

@zadjii-msft I'll give this a punt if thats okay. Would need some pointers, particularly surrounding how the UI works!

@Swinkid commented on GitHub (Mar 16, 2023): @zadjii-msft I'll give this a punt if thats okay. Would need some pointers, particularly surrounding how the UI works!
Author
Owner

@zadjii-msft commented on GitHub (Apr 28, 2023):

@Swinkid sorry I lost that in my inbox! Okay, here's some thoughts:

Note

Walkthrough

The "Open JSON File" button is defined here:
fc90045cc3/src/cascadia/TerminalSettingsEditor/MainPage.xaml (L156-L166)

I think it'd be easy to add a context menu flyout to it. Probably something like


                <NavigationViewItem.ContextFlyout>
                    <MenuFlyoutItem></MenuFlyoutItem>
                </NavigationViewItem.ContextFlyout>

To set the .ContextFlyout on it

It might be harder to change that button to like, a split button. But OP did say it was okay to implement this as a right-click context menu.

As far as what the button should actually do - MainPage::OpenJsonTapped currently just bubbles a SettingsTarget to the handler in fire_and_forget TerminalPage::_LaunchSettings.

So I'd:

  • add a new SettingsTarget for SettingsDirectory to ActionArgs.idl
  • Add a button handler to the MenuFlyoutItem in MainPage that just calls _OpenJsonHandlers(nullptr, SettingsTarget::SettingsDirectory);
  • add a case in TerminalPage::_LaunchSettings to open the directory for the settings, rather than the file itself.
@zadjii-msft commented on GitHub (Apr 28, 2023): @Swinkid sorry I lost that in my inbox! Okay, here's some thoughts: > **Note** > ## Walkthrough The "Open JSON File" button is defined here: https://github.com/microsoft/terminal/blob/fc90045cc37c4862f0d447f7ceb5fe1a20eea3fd/src/cascadia/TerminalSettingsEditor/MainPage.xaml#L156-L166 I think it'd be easy to add a context menu flyout to it. Probably something like ```xaml <NavigationViewItem.ContextFlyout> <MenuFlyoutItem></MenuFlyoutItem> </NavigationViewItem.ContextFlyout> ``` To set the [`.ContextFlyout`](https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.uielement.contextflyout?view=winrt-22621#windows-ui-xaml-uielement-contextflyout) on it It might be _harder_ to change that button to like, a split button. But OP did say it was okay to implement this as a right-click context menu. As far as what the button should actually _do_ - `MainPage::OpenJsonTapped` currently just bubbles a `SettingsTarget` to the handler in `fire_and_forget TerminalPage::_LaunchSettings`. So I'd: - add a new `SettingsTarget` for `SettingsDirectory` to `ActionArgs.idl` - Add a button handler to the `MenuFlyoutItem` in `MainPage` that just calls `_OpenJsonHandlers(nullptr, SettingsTarget::SettingsDirectory);` - add a case in `TerminalPage::_LaunchSettings` to open the directory for the settings, rather than the file itself.
Author
Owner

@AbdullahAlmanei commented on GitHub (May 24, 2023):

Created a PR for this issue! Take a look here: #15417
I couldn't set the Tooltip and the text through the resources for some reason. (It kept crashing whenever I tried linking the resources to the flyout menu using x:Uid) I might have been missing something simple, but I am not sure what exactly.

@AbdullahAlmanei commented on GitHub (May 24, 2023): Created a PR for this issue! Take a look here: #15417 I couldn't set the Tooltip and the text through the resources for some reason. (It kept crashing whenever I tried linking the resources to the flyout menu using x:Uid) I might have been missing something simple, but I am not sure what exactly.
Author
Owner

@AbdullahAlmanei commented on GitHub (May 30, 2023):

@zadjii-msft for #15417, would setting the text through resources be necessary? I've still not worked out why it's not working.

@AbdullahAlmanei commented on GitHub (May 30, 2023): @zadjii-msft for #15417, would setting the text through resources be necessary? I've still not worked out why it's not working.
Author
Owner

@zadjii-msft commented on GitHub (May 31, 2023):

The resources kinda are, actually. They're used for localization purposes, so only the .resw files get translated, and the .xaml files basically pick the correct translation up automatically.

That's pretty much entirely keyed off the x:Uid property in XAML. (I'll leave comments on the PR ☺️)

@zadjii-msft commented on GitHub (May 31, 2023): The resources kinda are, actually. They're used for localization purposes, so only the `.resw` files get translated, and the `.xaml` files basically pick the correct translation up automatically. That's pretty much entirely keyed off the `x:Uid` property in XAML. (I'll leave comments on the PR ☺️)
Author
Owner

@marcelwgn commented on GitHub (Mar 21, 2024):

@AbdullahAlmanei and @Swinkid are any of you working on this or is this up for grabs?

@marcelwgn commented on GitHub (Mar 21, 2024): @AbdullahAlmanei and @Swinkid are any of you working on this or is this up for grabs?
Author
Owner

@Swinkid commented on GitHub (Mar 21, 2024):

@AbdullahAlmanei and @Swinkid are any of you working on this or is this up for grabs?

Go ahead!

@Swinkid commented on GitHub (Mar 21, 2024): > @AbdullahAlmanei and @Swinkid are any of you working on this or is this up for grabs? Go ahead!
Author
Owner

@Ismith507 commented on GitHub (May 1, 2024):

Hello, I noticed that this issue has a stale PR(#15417) that is almost a year old. In the PR it seems like a diferent solution was proposed and still needs to be done. Should the solution be based on what was discussed in #15417, or is the proposed solution in this thread still relevant? I would like to submit my own PR and want to know what direction I should be going in.

@Ismith507 commented on GitHub (May 1, 2024): Hello, I noticed that this issue has a stale PR(#15417) that is almost a year old. In the PR it seems like a diferent solution was proposed and still needs to be done. Should the solution be based on what was discussed in #15417, or is the proposed solution in this thread still relevant? I would like to submit my own PR and want to know what direction I should be going in.
Author
Owner

@farheen-shaikh530 commented on GitHub (Jun 21, 2025):

Hi, I would love to work on this as my next contribution. Please assign it to me if available. Thank you!

@farheen-shaikh530 commented on GitHub (Jun 21, 2025): Hi, I would love to work on this as my next contribution. Please assign it to me if available. Thank you!
Author
Owner

@Chefkj commented on GitHub (Jun 24, 2025):

Proposal for: Add functionality to settings Open JSON file entry to open the settings.json parent folder in Explorer

Overview

Repository: microsoft/terminal
Issue URL: https://github.com/microsoft/terminal/issues/12382

Problem Analysis

The current functionality allows users to open the settings.json file directly from the Windows Terminal settings menu. However, it lacks a feature to open the parent folder of the settings.json file in the Windows Explorer. This is beneficial for users who want to easily navigate through other configuration files or related resources located within the same directory.

The issue arises because the current implementation focuses solely on opening the settings.json file, without providing an option to access its containing folder. To address this, we need to modify the existing UI and functionality to include a new action for opening the parent folder in Explorer.

Proposed Solution

  1. Add a New Menu Item: Introduce a new menu item next to the Open JSON file entry that allows users to open the parent folder of the settings.json file in Windows Explorer.
  2. Modify Existing UI Code: Update the existing UI code to include this new menu item, ensuring it aligns with Microsoft's coding standards and design principles.
  3. Implement Functionality: Develop the backend logic to handle the action of opening the folder in Explorer when the new menu item is selected.

Implementation Details

Architecture Considerations:

  • The solution will be integrated into the existing Windows Terminal application, specifically within the settings UI module.
  • The changes will ensure minimal impact on performance and security, adhering to Microsoft's standards for enterprise scenarios.

Code Changes:

  • Files to be Modified:
    • src/cascadia/AppSettings/SettingsPage.xaml (UI definition)
    • src/cascadia/AppSettings/SettingsPage.xaml.cs (code-behind logic)
  • Adherence to Microsoft Coding Standards:
    • Follow consistent naming conventions and coding practices.
    • Ensure proper error handling and logging.
    • Use appropriate design patterns, such as MVVM for UI components.

Testing Strategy

Unit Tests:

  • Write unit tests for the new menu item functionality using frameworks like MSTest or xUnit to ensure it behaves as expected under different conditions.

Integration Tests:

  • Perform integration tests to verify that the new feature works seamlessly with other parts of the application, particularly the settings UI and file handling logic.

Regression Prevention:

  • Include automated regression tests to prevent future issues related to this change. Ensure that existing functionalities remain unaffected by these modifications.

Timeline and Deliverables

  1. Week 1: Research and analyze the current implementation, design the solution, and create a detailed plan.
  2. Week 2: Implement the UI changes and add the new menu item.
  3. Week 3: Develop the backend functionality to open the folder in Explorer.
  4. Week 4: Write unit and integration tests, perform manual testing, and address any bugs or issues.
  5. Week 5: Submit a pull request with comprehensive documentation and test results.

Why This Approach

This approach aligns perfectly with Microsoft's development guidelines by:

  • Adding functionality that enhances user experience without disrupting existing features.
  • Adhering to the repository's coding standards, ensuring maintainability and scalability.
  • Leveraging Microsoft's established architecture patterns for seamless integration.

By following these steps, we can deliver a robust solution that meets the needs of the Windows Terminal user base while adhering to Microsoft's high-quality development practices.

@Chefkj commented on GitHub (Jun 24, 2025): # Proposal for: Add functionality to settings `Open JSON file` entry to open the settings.json parent folder in Explorer ## Overview **Repository**: microsoft/terminal **Issue URL**: https://github.com/microsoft/terminal/issues/12382 ## Problem Analysis The current functionality allows users to open the `settings.json` file directly from the Windows Terminal settings menu. However, it lacks a feature to open the parent folder of the `settings.json` file in the Windows Explorer. This is beneficial for users who want to easily navigate through other configuration files or related resources located within the same directory. The issue arises because the current implementation focuses solely on opening the `settings.json` file, without providing an option to access its containing folder. To address this, we need to modify the existing UI and functionality to include a new action for opening the parent folder in Explorer. ## Proposed Solution 1. **Add a New Menu Item**: Introduce a new menu item next to the `Open JSON file` entry that allows users to open the parent folder of the `settings.json` file in Windows Explorer. 2. **Modify Existing UI Code**: Update the existing UI code to include this new menu item, ensuring it aligns with Microsoft's coding standards and design principles. 3. **Implement Functionality**: Develop the backend logic to handle the action of opening the folder in Explorer when the new menu item is selected. ## Implementation Details **Architecture Considerations**: - The solution will be integrated into the existing Windows Terminal application, specifically within the settings UI module. - The changes will ensure minimal impact on performance and security, adhering to Microsoft's standards for enterprise scenarios. **Code Changes**: - **Files to be Modified**: - `src/cascadia/AppSettings/SettingsPage.xaml` (UI definition) - `src/cascadia/AppSettings/SettingsPage.xaml.cs` (code-behind logic) - **Adherence to Microsoft Coding Standards**: - Follow consistent naming conventions and coding practices. - Ensure proper error handling and logging. - Use appropriate design patterns, such as MVVM for UI components. ## Testing Strategy **Unit Tests**: - Write unit tests for the new menu item functionality using frameworks like MSTest or xUnit to ensure it behaves as expected under different conditions. **Integration Tests**: - Perform integration tests to verify that the new feature works seamlessly with other parts of the application, particularly the settings UI and file handling logic. **Regression Prevention**: - Include automated regression tests to prevent future issues related to this change. Ensure that existing functionalities remain unaffected by these modifications. ## Timeline and Deliverables 1. **Week 1**: Research and analyze the current implementation, design the solution, and create a detailed plan. 2. **Week 2**: Implement the UI changes and add the new menu item. 3. **Week 3**: Develop the backend functionality to open the folder in Explorer. 4. **Week 4**: Write unit and integration tests, perform manual testing, and address any bugs or issues. 5. **Week 5**: Submit a pull request with comprehensive documentation and test results. ## Why This Approach This approach aligns perfectly with Microsoft's development guidelines by: - Adding functionality that enhances user experience without disrupting existing features. - Adhering to the repository's coding standards, ensuring maintainability and scalability. - Leveraging Microsoft's established architecture patterns for seamless integration. By following these steps, we can deliver a robust solution that meets the needs of the Windows Terminal user base while adhering to Microsoft's high-quality development practices.
Author
Owner

@Arfa01 commented on GitHub (Jul 26, 2025):

Hello, I'm a student contributor interested in working on this issue as my first open-source contribution. May I take this up?

@Arfa01 commented on GitHub (Jul 26, 2025): Hello, I'm a student contributor interested in working on this issue as my first open-source contribution. May I take this up?
Author
Owner

@GzIrYsz commented on GitHub (Dec 30, 2025):

Hello, some changes have been merged about a year ago to add the "Open parent dir" option to the palette. Is it still relevant to work on some sort of flyout or similar (click with modifier as @carlos-zamora suggested)?

@GzIrYsz commented on GitHub (Dec 30, 2025): Hello, some changes have been merged about a year ago to add the "Open parent dir" option to the palette. Is it still relevant to work on some sort of flyout or similar (click with modifier as @carlos-zamora suggested)?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16650