Skip to content

Commit 68d9e0d

Browse files
authored
[Enterprise, GPO] Add "Default Terminal app" policy to definition template (#18363)
This PR adds a new policy definition to the ADMX templates for settings the default Terminal application in Windows. > [!Note] > This PR does not change any code of Windows, Console Host or Windows Terminal. It only adds the definition for a new policy to the templates. I got the registry values form the documentation and by testing the values. The policy is only available as user policy because the registry values have to be in HKCU. The Policy is implemented as preference (not inside the Policy key) and therefore keeps it's value on removing (not configured) it. You can see this in `gpedit.msc` on the policy symbol and the hint in the description. Closes #18302 Refs #18303
1 parent 712ce5f commit 68d9e0d

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

Diff for: policies/WindowsTerminal.admx

+57
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<supportedOn>
1010
<definitions>
1111
<definition name="SUPPORTED_WindowsTerminal_1_21" displayName="$(string.SUPPORTED_WindowsTerminal_1_21)" />
12+
<definition name="SUPPORTED_DefaultTerminalApplication" displayName="$(string.SUPPORTED_DefaultTerminalApplication)" />
1213
</definitions>
1314
</supportedOn>
1415
<categories>
@@ -24,5 +25,61 @@
2425
<multiText id="DisabledProfileSources" valueName="DisabledProfileSources" required="true" />
2526
</elements>
2627
</policy>
28+
<policy name="DefaultTerminalApplication" class="User" displayName="$(string.DefaultTerminalApplication)" explainText="$(string.DefaultTerminalApplicationText)" presentation="$(presentation.TermAppSelection)" key="Console\%%Startup">
29+
<parentCategory ref="WindowsTerminal" />
30+
<supportedOn ref="SUPPORTED_DefaultTerminalApplication" />
31+
<elements>
32+
<enum id="TermAppSelect" required="true" valueName="DelegationTerminal">
33+
<item displayName="$(string.TermAppAutomatic)">
34+
<value>
35+
<string>{00000000-0000-0000-0000-000000000000}</string>
36+
</value>
37+
<valueList>
38+
<item key="Console\%%Startup" valueName="DelegationConsole">
39+
<value>
40+
<string>{00000000-0000-0000-0000-000000000000}</string>
41+
</value>
42+
</item>
43+
</valueList>
44+
</item>
45+
<item displayName="$(string.TermAppConsoleHost)">
46+
<value>
47+
<string>{B23D10C0-E52E-411E-9D5B-C09FDF709C7D}</string>
48+
</value>
49+
<valueList>
50+
<item key="Console\%%Startup" valueName="DelegationConsole">
51+
<value>
52+
<string>{B23D10C0-E52E-411E-9D5B-C09FDF709C7D}</string>
53+
</value>
54+
</item>
55+
</valueList>
56+
</item>
57+
<item displayName="$(string.TermAppWindowsTerminal)">
58+
<value>
59+
<string>{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}</string>
60+
</value>
61+
<valueList>
62+
<item key="Console\%%Startup" valueName="DelegationConsole">
63+
<value>
64+
<string>{2EACA947-7F5F-4CFA-BA87-8F7FBEEFBE69}</string>
65+
</value>
66+
</item>
67+
</valueList>
68+
</item>
69+
<item displayName="$(string.TermAppWindowsTerminalPreview)">
70+
<value>
71+
<string>{86633F1F-6454-40EC-89CE-DA4EBA977EE2}</string>
72+
</value>
73+
<valueList>
74+
<item key="Console\%%Startup" valueName="DelegationConsole">
75+
<value>
76+
<string>{06EC847C-C0A5-46B8-92CB-7C92F6E35CD5}</string>
77+
</value>
78+
</item>
79+
</valueList>
80+
</item>
81+
</enum>
82+
</elements>
83+
</policy>
2784
</policies>
2885
</policyDefinitions>

Diff for: policies/en-US/WindowsTerminal.adml

+12
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<stringTable>
88
<string id="WindowsTerminal">Windows Terminal</string>
99
<string id="SUPPORTED_WindowsTerminal_1_21">At least Windows Terminal 1.21</string>
10+
<string id="SUPPORTED_DefaultTerminalApplication">At least Windows 11 22H2 or Windows 10 22H2 (Build 19045.3031, KB5026435) with Windows Terminal 1.17</string>
1011
<string id="DisabledProfileSources">Disabled Profile Sources</string>
1112
<string id="DisabledProfileSourcesText">Profiles will not be generated from any sources listed here. Source names can be arbitrary strings. Potential candidates can be found as the "source" property on profile definitions in Windows Terminal's settings.json file.
1213

@@ -18,11 +19,22 @@ Common sources are:
1819
For instance, setting this policy to Windows.Terminal.Wsl will disable the builtin WSL integration of Windows Terminal.
1920

2021
Note: Existing profiles will disappear from Windows Terminal after adding their source to this policy.</string>
22+
<string id="DefaultTerminalApplication">Default terminal application</string>
23+
<string id="DefaultTerminalApplicationText">Select the default terminal application used in Windows.
24+
25+
If you select Windows Terminal Preview and it is not installed the system will fallback to the legacy Windows Console Host. (Please note that the settings interfaces showing "Let windows decide" in this case as configuration.)</string>
26+
<string id="TermAppAutomatic">Automatic selection (Windows Terminal, if available)</string>
27+
<string id="TermAppConsoleHost">Windows Console Host (legacy)</string>
28+
<string id="TermAppWindowsTerminal">Windows Terminal</string>
29+
<string id="TermAppWindowsTerminalPreview">Windows Terminal Preview (if available)</string>
2130
</stringTable>
2231
<presentationTable>
2332
<presentation id="DisabledProfileSources">
2433
<multiTextBox refId="DisabledProfileSources">List of disabled sources (one per line)</multiTextBox>
2534
</presentation>
35+
<presentation id="TermAppSelection">
36+
<dropdownList refId="TermAppSelect" noSort="true" defaultItem="0">Select from the following options:</dropdownList>
37+
</presentation>
2638
</presentationTable>
2739
</resources>
2840
</policyDefinitionResources>

0 commit comments

Comments
 (0)