wt-bg
Switch your Windows Terminal background from the command line, or find a color
with a live, mouse-and-keyboard color picker. Save favorites as named presets.
Install
On Windows with Go 1.27.3 or newer:
go install github.com/AspireOne/wt-bg@latest
Make sure your Go binary directory (normally %USERPROFILE%\go\bin) is on PATH.
Run the same command to update. Alternatively, download the Windows AMD64 or
ARM64 archive from Releases,
extract it, and put wt-bg.exe on PATH. Go is not required for these builds.
Use
wt-bg status
wt-bg pick
wt-bg switch '#1e1e2e'
wt-bg save midnight
wt-bg switch midnight
wt-bg reset
Quote hex colors: # starts a comment in PowerShell. Both '#123' and
'#112233' work. wt-bg help lists all commands, including saving an explicit
color, overwriting a preset with --force, and removing presets.
In the picker, use the mouse or arrow keys to choose a color, [ / ] to change
hue, and Tab to cycle through presets. Shift+Arrows and { / } make finer
adjustments. Enter keeps the color; Esc, Ctrl+C, or q cancels and restores the
previous background. The picker needs an interactive pane of at least 48 × 18
characters.
Settings and scope
wt-bg changes profiles.defaults.background in Windows Terminal's settings
file. This is a persistent change across profiles that inherit the default
background, including other open tabs and windows. Profiles with their own
background override keep it; wt-bg reports them. reset removes the default
background override so color schemes apply again.
The tool preserves JSON comments and trailing commas, leaves color schemes
untouched, and follows symlinked settings files. Presets live in
%APPDATA%\wt-bg\presets.json.
Store stable, Store Preview, and unpackaged installations are detected under
%LOCALAPPDATA%. If more than one settings file exists, select one explicitly.
For example, in PowerShell:
$env:WT_BG_SETTINGS = "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json"
wt-bg status
Set this variable in your shell profile to keep the selection. It also supports
portable installations and other custom settings locations. An explicit path
that cannot be read fails without falling back to another installation.
v0.1 supports built-in schemes and user-defined schemes selected by a string in
profiles.defaults.colorScheme. An omitted scheme uses Campbell. The light/dark
object form of colorScheme, profile-specific scheme reporting, and unfocused
appearance overrides are outside this release's scope. Background images,
opacity, and acrylic can also affect the color you see.
The picker writes live previews to the settings file. Avoid editing that file
elsewhere while picking. Cancellation restores the original background during a
normal exit; forcibly killing the process or losing power can leave the last
preview applied.
Development
Build and test on Windows:
go test -race ./...
go vet ./...
go build .
Tests use temporary settings and preset files. They do not edit your terminal
configuration. Windows CI runs these checks and verifies an ARM64 build.
License
MIT.