Respect externally managed Windows Terminal settings - #2
Merged
Merged
Conversation
- Write-Utf8FileAtomic writes a symlinked target in place instead of replacing the link with a regular file, so a settings.json that lives in a dotfiles repo survives Update-Profile and Set-TerminalBackground. - New user-settings.json option windowsTerminal.manage = false: setup.ps1, Update-Profile and Set-TerminalBackground leave settings.json alone, and Uninstall-Profile keeps a symlinked settings.json in place. - psp-doctor gains a Terminal category that shows whether settings.json is a symlink and who manages it. - The wizard now defaults PSReadLine colors to "Derive from color scheme". - README and the user-settings.json template document the new option.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows Terminal's
settings.jsoncan be owned by another tool, typically a dotfiles repo that symlinks it into place. This change makes the profile a good neighbour in that setup.Write-Utf8FileAtomicwrites a symlinked target in place instead of replacing the link with a regular file, soUpdate-ProfileandSet-TerminalBackgroundno longer break the link.user-settings.jsonoptionwindowsTerminal.manage = false:setup.ps1step 10,Update-Profilephase 6 andSet-TerminalBackgroundleavesettings.jsonalone;Uninstall-Profilekeeps a symlinkedsettings.jsonin place, also with-HardResetWindowsTerminal.psp-doctorgains a Terminal category showing whethersettings.jsonis a symlink and who manages it.user-settings.jsontemplate document the option.Verified locally:
tests/lint.ps1clean with PSScriptAnalyzer 1.24.0, PS 5.1 parse, profile load withCI=truein 5.1 and 7 with zero errors, a symlink round-trip test ofWrite-Utf8FileAtomicin both editions, andTest-ProfileHealthoutput.tests/test.ps1was not run locally.