microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.26k stars 8.27k forks source link

Make path to `settings.json` configurable #17641

Closed mu88 closed 2 months ago

mu88 commented 2 months ago

Description of the new feature/enhancement

At the moment, the Windows Terminal settings file settings.json is located at a rather cryptic location, e.g. C:\Users\MyUser\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json. Furthermore, it varies on different environments, e.g. it is different on my business laptop although using the same app version.
Last but not least, the hard-to-guess location makes it nearly impossible to put the file under version control without using techniques like symbolic links.

Therefore, it would be nice if one could specify from where Windows Terminal loads its settings.

Proposed technical implementation details (optional)

An easy way could be to introduce an environment variable (e.g. WT_CONFIG_FILE, pointing to C:\dev\GitHub\dotfiles\WindowsTerminal\settings.json) which gets picked up by Windows Terminal when starting the app. In case the environment variable is present, it will be picked up, otherwise it falls back to the default settings location (e.g. C:\Users\MyUser\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json).

similar-issues-ai[bot] commented 2 months ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by πŸ‘ or πŸ‘Ž this comment.

mu88 commented 2 months ago

duplicate of https://github.com/microsoft/terminal/issues/2933