mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 18:43:54 -06:00
Improve startingDirectory functionality (#604)
* Improve `startingDirectory` functionality This commit adds the `startingDirectory` property to the default-created `cmd` and `powershell` profiles, with the default value `%HOMEDRIVE%%HOMEPATH%`. Signed-off-by: Fred Miller <fghzxm@outlook.com> * Use %USERPROFILE% to replace %HOMEDRIVE%%HOMEPATH% This commit changes `%USERPROFILE%` in the default profiles to `%HOMEDRIVE%%HOMEPATH%`. https://stackoverflow.com/posts/36392591/revisions says `%USERPROFILE%` is better than `%HOMEDRIVE%%HOMEPATH%`, so changed it. Signed-off-by: Fred Miller <fghzxm@outlook.com> * Improve `startingDirectory` functionality This commit adds the `startingDirectory` property to the default-created `cmd` and `powershell` profiles, with the default value `%HOMEDRIVE%%HOMEPATH%`. Signed-off-by: Fred Miller <fghzxm@outlook.com> * Use %USERPROFILE% to replace %HOMEDRIVE%%HOMEPATH% This commit changes `%USERPROFILE%` in the default profiles to `%HOMEDRIVE%%HOMEPATH%`. https://stackoverflow.com/posts/36392591/revisions says `%USERPROFILE%` is better than `%HOMEDRIVE%%HOMEPATH%`, so changed it. Signed-off-by: Fred Miller <fghzxm@outlook.com> * Consolidate constant Refer to the externally defined constant in code. Signed-off-by: Fred Miller <fghzxm@outlook.com>
This commit is contained in:
parent
bf460ab7fe
commit
6088134832
@ -6,6 +6,7 @@
|
|||||||
#include <conattrs.hpp>
|
#include <conattrs.hpp>
|
||||||
#include "CascadiaSettings.h"
|
#include "CascadiaSettings.h"
|
||||||
#include "../../types/inc/utils.hpp"
|
#include "../../types/inc/utils.hpp"
|
||||||
|
#include "../../inc/DefaultSettings.h"
|
||||||
|
|
||||||
using namespace winrt::Microsoft::Terminal::Settings;
|
using namespace winrt::Microsoft::Terminal::Settings;
|
||||||
using namespace ::TerminalApp;
|
using namespace ::TerminalApp;
|
||||||
@ -107,7 +108,6 @@ void CascadiaSettings::_CreateDefaultSchemes()
|
|||||||
_globals.GetColorSchemes().emplace_back(_CreateCampbellScheme());
|
_globals.GetColorSchemes().emplace_back(_CreateCampbellScheme());
|
||||||
_globals.GetColorSchemes().emplace_back(_CreateSolarizedDarkScheme());
|
_globals.GetColorSchemes().emplace_back(_CreateSolarizedDarkScheme());
|
||||||
_globals.GetColorSchemes().emplace_back(_CreateSolarizedLightScheme());
|
_globals.GetColorSchemes().emplace_back(_CreateSolarizedLightScheme());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method Description:
|
// Method Description:
|
||||||
@ -123,6 +123,7 @@ void CascadiaSettings::_CreateDefaultProfiles()
|
|||||||
Profile cmdProfile{};
|
Profile cmdProfile{};
|
||||||
cmdProfile.SetFontFace(L"Consolas");
|
cmdProfile.SetFontFace(L"Consolas");
|
||||||
cmdProfile.SetCommandline(L"cmd.exe");
|
cmdProfile.SetCommandline(L"cmd.exe");
|
||||||
|
cmdProfile.SetStartingDirectory(DEFAULT_STARTING_DIRECTORY);
|
||||||
cmdProfile.SetColorScheme({ L"Campbell" });
|
cmdProfile.SetColorScheme({ L"Campbell" });
|
||||||
cmdProfile.SetAcrylicOpacity(0.75);
|
cmdProfile.SetAcrylicOpacity(0.75);
|
||||||
cmdProfile.SetUseAcrylic(true);
|
cmdProfile.SetUseAcrylic(true);
|
||||||
@ -143,6 +144,7 @@ void CascadiaSettings::_CreateDefaultProfiles()
|
|||||||
}
|
}
|
||||||
powershellProfile.SetFontFace(L"Courier New");
|
powershellProfile.SetFontFace(L"Courier New");
|
||||||
powershellProfile.SetCommandline(psCmdline);
|
powershellProfile.SetCommandline(psCmdline);
|
||||||
|
powershellProfile.SetStartingDirectory(DEFAULT_STARTING_DIRECTORY);
|
||||||
powershellProfile.SetColorScheme({ L"Campbell" });
|
powershellProfile.SetColorScheme({ L"Campbell" });
|
||||||
powershellProfile.SetDefaultBackground(RGB(1, 36, 86));
|
powershellProfile.SetDefaultBackground(RGB(1, 36, 86));
|
||||||
powershellProfile.SetUseAcrylic(false);
|
powershellProfile.SetUseAcrylic(false);
|
||||||
|
|||||||
@ -427,6 +427,11 @@ void Profile::SetCommandline(std::wstring cmdline) noexcept
|
|||||||
_commandline = cmdline;
|
_commandline = cmdline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Profile::SetStartingDirectory(std::wstring startingDirectory) noexcept
|
||||||
|
{
|
||||||
|
_startingDirectory = startingDirectory;
|
||||||
|
}
|
||||||
|
|
||||||
void Profile::SetName(std::wstring name) noexcept
|
void Profile::SetName(std::wstring name) noexcept
|
||||||
{
|
{
|
||||||
_name = name;
|
_name = name;
|
||||||
|
|||||||
@ -40,6 +40,7 @@ public:
|
|||||||
void SetColorScheme(std::optional<std::wstring> schemeName) noexcept;
|
void SetColorScheme(std::optional<std::wstring> schemeName) noexcept;
|
||||||
void SetAcrylicOpacity(double opacity) noexcept;
|
void SetAcrylicOpacity(double opacity) noexcept;
|
||||||
void SetCommandline(std::wstring cmdline) noexcept;
|
void SetCommandline(std::wstring cmdline) noexcept;
|
||||||
|
void SetStartingDirectory(std::wstring startingDirectory) noexcept;
|
||||||
void SetName(std::wstring name) noexcept;
|
void SetName(std::wstring name) noexcept;
|
||||||
void SetUseAcrylic(bool useAcrylic) noexcept;
|
void SetUseAcrylic(bool useAcrylic) noexcept;
|
||||||
void SetDefaultForeground(COLORREF defaultForeground) noexcept;
|
void SetDefaultForeground(COLORREF defaultForeground) noexcept;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user