microsoft / microsoft/terminal
Deleting the reference to a profile from a JSON fragment file prevents the profile from showing back up again even when the profile still exists in the fragment file.
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
### Windows Terminal version
1.14.2282.0
### Windows build number
10.0.22000.0
### Other Software
_No response_
### Steps to reproduce
1. Create a fragment file with a profile in it.
- Absolute path: `$Env:LocalAppData\Microsoft\Windows Terminal\Fragments\TestFragmentDir\testFragment.json`
3. Launch Windows Terminal.
4. The profile from the fragment file appears in the profile drop down.
5. Close Windows Terminal.
6. Remove the reference to the `testFragment.json` profile from the `settings.json` file.
7. Launch Windows Terminal.
8. The profile from the fragment file does not appear in the profile drop down.
9. The fragment file with the profile in it still exists, along with the profile.
### Expected Behavior
Either:
- Remove the profile from the fragment file `testFragment.json` in addition to the reference to said profile from the `settings.json` file.
or
- Upon reopening Windows Terminal after removing the reference to the `testFragment.json` profile from the `settings.json` file, the reference should reappear (as the fragment file containing the profile still exists).
### Actual Behavior
As listed in **_Steps to reproduce_**.
Scenario where this is an issue:
- My team provides users a set of fragment files containing profiles (with very specific GUIDs).
- The fragment files are automatically generated as part of a script which users execute.
- These profiles define the CLIs which users must interact with for interfacing with a set of repositories.
- User **_U_** tinkers with their `settings.json` file, removing several profiles, including references to the profiles from the fragment files that we provided them.
- **_U_** no longer sees the profiles associated with the fragment files we gave them, even though the fragment files still exist and have not been modified.
- **_U_** alerts our team that they see the profiles in the fragment files, yet Windows Terminal won't show them.
- **_U_** informs that they are unable to access the CLIs associated with their work (as defined by the profiles in the fragment files).
- **_U_** deletes their repository, re-clones it, then generates the fragment files again, in an attempt to get Windows Terminal to show the CLIs for the repository.
- **_U_** smashes their keyboard into their monitor when nothing is working, and promptly leans back in their chair and contemplates their life choices.
Contributor guide
Research direction
Reproduce the issue with the fragment file at $Env:LocalAppData\Microsoft\Windows Terminal\Fragments\TestFragmentDir\testFragment.json and the related entry in settings.json. Trace how Windows Terminal loads fragment profiles and handles their removal, then verify that removing the reference either removes the fragment profile or restores it while the fragment file still exists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100