Skip to content

Commit 0ba3782

Browse files
committed
add WT_BASE_SETTINGS_PATH env variable
1 parent 421ff6c commit 0ba3782

File tree

5 files changed

+39
-10
lines changed

5 files changed

+39
-10
lines changed

src/cascadia/CascadiaPackage/Package-Dev.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<Identity Name="WindowsTerminalDev"
2020
Publisher="CN=Dm17tryK"
21-
Version="1.24.53103.3" />
21+
Version="1.24.53104.3" />
2222

2323
<Properties>
2424
<DisplayName>ms-resource:AppStoreNameDev</DisplayName>

src/cascadia/TerminalApp/TerminalAppLib.vcxproj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@
312312
<DependentUpon>MarkdownPaneContent.xaml</DependentUpon>
313313
<SubType>Code</SubType>
314314
</ClCompile>
315-
316315
</ItemGroup>
317316
<!-- ========================= idl Files ======================== -->
318317
<ItemGroup>
@@ -443,7 +442,6 @@
443442
<Private>true</Private>
444443
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
445444
</ProjectReference>
446-
447445
</ItemGroup>
448446
<PropertyGroup>
449447
<!-- This is a hack to get the ARM64 CI build working. See
@@ -508,6 +506,14 @@
508506
<AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories);</AdditionalIncludeDirectories>
509507
<!-- Manually disable unreachable code warning, because jconcpp has a ton of that. -->
510508
<DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
509+
<TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</TreatWarningAsError>
510+
<TreatSpecificWarningsAsErrors Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4189;4242;4389;4244</TreatSpecificWarningsAsErrors>
511+
<TreatSpecificWarningsAsErrors Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4189;4242;4389;4244</TreatSpecificWarningsAsErrors>
512+
<TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</TreatWarningAsError>
513+
<TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</TreatWarningAsError>
514+
<TreatSpecificWarningsAsErrors Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4189;4242;4389;4244</TreatSpecificWarningsAsErrors>
515+
<TreatSpecificWarningsAsErrors Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">4189;4242;4389;4244</TreatSpecificWarningsAsErrors>
516+
<TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</TreatWarningAsError>
511517
</ClCompile>
512518
<Link>
513519
<AdditionalDependencies>WindowsApp.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -537,4 +543,4 @@
537543
</ItemGroup>
538544
</Target>
539545
<Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
540-
</Project>
546+
</Project>

src/cascadia/TerminalApp/TerminalAppLib.vcxproj.filters

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
</ClCompile>
4444
<ClCompile Include="Toast.cpp" />
4545
<ClCompile Include="LanguageProfileNotifier.cpp" />
46-
<ClCompile Include="Monarch.cpp" />
47-
<ClCompile Include="Peasant.cpp" />
4846
</ItemGroup>
4947
<ItemGroup>
5048
<ClInclude Include="pch.h" />
@@ -80,8 +78,6 @@
8078
<ClInclude Include="Toast.h" />
8179
<ClInclude Include="LanguageProfileNotifier.h" />
8280
<ClInclude Include="WindowsPackageManagerFactory.h" />
83-
<ClInclude Include="Monarch.h" />
84-
<ClInclude Include="Peasant.h" />
8581
</ItemGroup>
8682
<ItemGroup>
8783
<Midl Include="AppLogic.idl">
@@ -111,7 +107,7 @@
111107
<Midl Include="TaskbarState.idl" />
112108
<Midl Include="IPaneContent.idl" />
113109
<Midl Include="TerminalSettingsCache.idl" />
114-
<Midl Include="Monarch.idl" />
110+
<Midl Include="Remoting.idl" />
115111
</ItemGroup>
116112
<ItemGroup>
117113
<Page Include="MinMaxCloseControl.xaml">
@@ -153,6 +149,7 @@
153149
<Page Include="AboutDialog.xaml" />
154150
<Page Include="SuggestionsControl.xaml" />
155151
<Page Include="SnippetsPaneContent.xaml" />
152+
<Page Include="MarkdownPaneContent.xaml" />
156153
</ItemGroup>
157154
<ItemGroup>
158155
<Filter Include="app">
@@ -182,4 +179,4 @@
182179
<Filter>app</Filter>
183180
</ApplicationDefinition>
184181
</ItemGroup>
185-
</Project>
182+
</Project>

src/cascadia/TerminalControl/TerminalControlLib.vcxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@
173173
<ClCompile>
174174
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
175175
<AdditionalIncludeDirectories>$(OpenConsoleDir)src\cascadia\inc;$(OpenConsoleDir)src\types\inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
176+
<TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</TreatWarningAsError>
177+
<TreatSpecificWarningsAsErrors Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4189;4242;4389;4244</TreatSpecificWarningsAsErrors>
178+
<TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</TreatWarningAsError>
179+
<TreatSpecificWarningsAsErrors Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4189;4242;4389;4244</TreatSpecificWarningsAsErrors>
180+
<TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</TreatWarningAsError>
181+
<TreatSpecificWarningsAsErrors Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">4189;4242;4389;4244</TreatSpecificWarningsAsErrors>
182+
<TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</TreatWarningAsError>
183+
<TreatSpecificWarningsAsErrors Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4189;4242;4389;4244</TreatSpecificWarningsAsErrors>
176184
</ClCompile>
177185
<Reference>
178186
<Private>false</Private>

src/cascadia/TerminalSettingsModel/FileUtils.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#include <shlobj.h>
99
#include <WtExeUtils.h>
1010

11+
#define ENV_WT_BASE_SETTINGS_PATH L"WT_BASE_SETTINGS_PATH"
12+
1113
static constexpr std::wstring_view UnpackagedSettingsFolderName{ L"Microsoft\\Windows Terminal\\" };
1214
static constexpr std::wstring_view ReleaseSettingsFolder{ L"Packages\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\LocalState\\" };
1315
static constexpr std::wstring_view PortableModeMarkerFile{ L".portable" };
@@ -30,6 +32,14 @@ namespace winrt::Microsoft::Terminal::Settings::Model
3032
std::filesystem::path GetBaseSettingsPath()
3133
{
3234
static auto baseSettingsPath = []() {
35+
try
36+
{
37+
std::filesystem::path envSettingsPath{ wil::GetEnvironmentVariableW<std::wstring>(ENV_WT_BASE_SETTINGS_PATH) };
38+
std::filesystem::create_directories(envSettingsPath);
39+
return envSettingsPath;
40+
}
41+
CATCH_LOG()
42+
3343
if (!IsPackaged() && IsPortableMode())
3444
{
3545
std::filesystem::path modulePath{ wil::GetModuleFileNameW<std::wstring>(wil::GetModuleInstanceHandle()) };
@@ -64,6 +74,14 @@ namespace winrt::Microsoft::Terminal::Settings::Model
6474
std::filesystem::path GetReleaseSettingsPath()
6575
{
6676
static std::filesystem::path baseSettingsPath = []() {
77+
try
78+
{
79+
std::filesystem::path envSettingsPath{ wil::GetEnvironmentVariableW<std::wstring>(ENV_WT_BASE_SETTINGS_PATH) };
80+
std::filesystem::create_directories(envSettingsPath);
81+
return envSettingsPath;
82+
}
83+
CATCH_LOG()
84+
6785
wil::unique_cotaskmem_string localAppDataFolder;
6886
// We're using KF_FLAG_NO_PACKAGE_REDIRECTION to ensure that we always get the
6987
// user's actual local AppData directory.

0 commit comments

Comments
 (0)