Skip to content

Respect externally managed Windows Terminal settings - #2

Merged
26zl merged 1 commit into
mainfrom
windows-terminal-ownership
Sep 16, 2026
Merged

26zl merged 1 commit into
mainfrom
windows-terminal-ownership

Conversation

@26zl

@26zl 26zl commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Windows Terminal's settings.json can 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-Utf8FileAtomic writes a symlinked target in place instead of replacing the link with a regular file, so Update-Profile and Set-TerminalBackground no longer break the link.
  • New user-settings.json option windowsTerminal.manage = false: setup.ps1 step 10, Update-Profile phase 6 and Set-TerminalBackground leave settings.json alone; Uninstall-Profile keeps a symlinked settings.json in place, also with -HardResetWindowsTerminal.
  • psp-doctor gains a Terminal category showing whether settings.json is a symlink and who manages it.
  • The wizard defaults PSReadLine colors to "Derive from color scheme" so the syntax palette follows the chosen scheme.
  • README and the user-settings.json template document the option.

Verified locally: tests/lint.ps1 clean with PSScriptAnalyzer 1.24.0, PS 5.1 parse, profile load with CI=true in 5.1 and 7 with zero errors, a symlink round-trip test of Write-Utf8FileAtomic in both editions, and Test-ProfileHealth output. tests/test.ps1 was not run locally.

- 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.
@26zl
26zl merged commit fc685d0 into main Sep 16, 2026
5 of 6 checks passed
@26zl
26zl deleted the windows-terminal-ownership branch September 16, 2026 23:10
@26zl 26zl self-assigned this Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant