From 7cb726caee38aa15f172777b4773f8cbfaccc42c Mon Sep 17 00:00:00 2001 From: boukeversteegh Date: Thu, 22 Jan 2026 11:27:08 +0100 Subject: [PATCH] Add documentation for profile.environment setting Documents the `environment` profile setting that allows users to set environment variables for individual profiles. Co-Authored-By: Claude Opus 4.5 --- .../customize-settings/profile-advanced.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/TerminalDocs/customize-settings/profile-advanced.md b/TerminalDocs/customize-settings/profile-advanced.md index 7206f801..cb57034a 100644 --- a/TerminalDocs/customize-settings/profile-advanced.md +++ b/TerminalDocs/customize-settings/profile-advanced.md @@ -100,6 +100,25 @@ This sets the number of lines above the ones displayed in the window you can scr ___ +## Environment variables + +This sets additional environment variables that will be passed to the process started in the profile. This setting is only available in the [settings.json file](../install.md#settings-json-file) and is not configurable via the settings UI. + +**Property name:** `environment` + +**Necessity:** Optional + +**Accepts:** An object with string keys and values, for example: `"environment": { "VAR_NAME": "value" }` + +**Example:** To add environment variables `FOO` and `BAR` to your PowerShell profile, add `"environment": { "FOO": "one", "BAR": "two" }` to that profile. + +> [!NOTE] +> When a profile specifies its own `environment`, it completely replaces any environment variables set in the `defaults` section rather than merging with them. Profiles without their own `environment` setting will still inherit from `defaults`. + +
+ +___ + ## Profile termination behavior This sets how the profile reacts to termination or failure to launch. `"graceful"` will close the profile when `exit` is typed or when the process exits normally. `"always"` will always close the profile and `"never"` will never close the profile. `"automatic"` was added once Windows Terminal was allowed to be the default terminal application; for processes launched in Terminal directly, it behaves the same as `"graceful"` but for processes that were handed off to Terminal it behaves the same as `"always"`.