Repository: microsoft/terminal
File: src/cascadia/TerminalSettingsModel/MTSMSettings.h (C/C++)

Code before:
// * TerminalSettings.cpp: TerminalSettings::_ApplyProfileSettings
// * IControlSettings.idl or ICoreSettings.idl
// * ControlProperties.h
#define MTSM_PROFILE_SETTINGS(X)                                                                                                                               \
    X(int32_t, HistorySize, "historySize", DEFAULT_HISTORY_SIZE)                                                                                               \
    X(bool, SnapOnInput, "snapOnInput", true)                                                                                                                  \
    X(bool, AltGrAliasing, "altGrAliasing", true)                                                                                                              \
    X(hstring, AnswerbackMessage, "answerbackMessage")                                                                                                         \
    X(hstring, Commandline, "commandline", L"%SystemRoot%\\System32\\cmd.exe")                                                                                 \
    X(Microsoft::Terminal::Control::ScrollbarState, ScrollState, "scrollbarState", Microsoft::Terminal::Control::ScrollbarState::Visible)                      \
    X(Microsoft::Terminal::Control::TextAntialiasingMode, AntialiasingMode, "antialiasingMode", Microsoft::Terminal::Control::TextAntialiasingMode::Grayscale) \
    X(hstring, StartingDirectory, "startingDirectory")                                                                                                         \
    X(bool, SuppressApplicationTitle, "suppressApplicationTitle", false)                                                                                       \
    X(guid, ConnectionType, "connectionType")                                                                                                                  \
    X(CloseOnExitMode, CloseOnExit, "closeOnExit", CloseOnExitMode::Automatic)                                                                                 \
    X(hstring, TabTitle, "tabTitle")                                                                                                                           \
    X(Model::BellStyle, BellStyle, "bellStyle", BellStyle::Audible)                                                                                            \
    X(IEnvironmentVariableMap, EnvironmentVariables, "environment", nullptr)                                                                                   \
    X(bool, RightClickContextMenu, "rightClickContextMenu", false)                                                                                             \
    X(Windows::Foundation::Collections::IVector<winrt::hstring>, BellSound, "bellSound", nullptr)                                                              \
    X(bool, Elevate, "elevate", false)                                                                                                                         \
    X(bool, AutoMarkPrompts, "autoMarkPrompts", true)                                                                                                          \
    X(bool, ShowMarks, "showMarksOnScrollbar", false)                                                                                                          \
    X(bool, RepositionCursorWithMouse, "experimental.repositionCursorWithMouse", false)                                                                        \
    X(bool, ReloadEnvironmentVariables, "compatibility.reloadEnvironmentVariables", true)                                                                      \
    X(bool, RainbowSuggestions, "rainbowSuggestions", false)

// Intentionally omitted Profile settings:
// * Name
// * Updates
// * Guid
// * Hidden
// * Source
// * Padding: needs special FromJson parsing
// * TabColor: is an optional setting, so needs to be set with INHERITABLE_NULLABLE_SETTING

#define MTSM_FONT_SETTINGS(X)                                                          \
    X(hstring, FontFace, "face", DEFAULT_FONT_FACE)                                    \
    X(float, FontSize, "size", DEFAULT_FONT_SIZE)                                      \
    X(winrt::Windows::UI::Text::FontWeight, FontWeight, "weight", DEFAULT_FONT_WEIGHT) \
    X(IFontAxesMap, FontAxes, "axes")                                                  \
    X(IFontFeatureMap, FontFeatures, "features")                                       \
    X(bool, EnableBuiltinGlyphs, "builtinGlyphs", true)                                \
    X(bool, EnableColorGlyphs, "colorGlyphs", true)                                    \
    X(winrt::hstring, CellWidth, "cellWidth")                                          \
    X(winrt::hstring, CellHeight, "cellHeight")

#define MTSM_APPEARANCE_SETTINGS(X)                                                                                                                                \
    X(Core::CursorStyle, CursorShape, "cursorShape", Core::CursorStyle::Bar)                                                                                       \
    X(uint32_t, CursorHeight, "cursorHeight", DEFAULT_CURSOR_HEIGHT)                                                                                               \
    X(float, BackgroundImageOpacity, "backgroundImageOpacity", 1.0f)                                                                                               \

Review comment (suggestion):
Personally, I'd prefer if this remained experimental, because I feel like the feature is a little "goofy". It's a neat trick, but I'm not sure if it's serious enough that we should guarantee perpetual support.

Code after:
// * TerminalSettings.cpp: TerminalSettings::_ApplyProfileSettings
// * IControlSettings.idl or ICoreSettings.idl
// * ControlProperties.h
#define MTSM_PROFILE_SETTINGS(X)                                                                                                                               \
    X(int32_t, HistorySize, "historySize", DEFAULT_HISTORY_SIZE)                                                                                               \
    X(bool, SnapOnInput, "snapOnInput", true)                                                                                                                  \
    X(bool, AltGrAliasing, "altGrAliasing", true)                                                                                                              \
    X(hstring, AnswerbackMessage, "answerbackMessage")                                                                                                         \
    X(hstring, Commandline, "commandline", L"%SystemRoot%\\System32\\cmd.exe")                                                                                 \
    X(Microsoft::Terminal::Control::ScrollbarState, ScrollState, "scrollbarState", Microsoft::Terminal::Control::ScrollbarState::Visible)                      \
    X(Microsoft::Terminal::Control::TextAntialiasingMode, AntialiasingMode, "antialiasingMode", Microsoft::Terminal::Control::TextAntialiasingMode::Grayscale) \
    X(hstring, StartingDirectory, "startingDirectory")                                                                                                         \
    X(bool, SuppressApplicationTitle, "suppressApplicationTitle", false)                                                                                       \
    X(guid, ConnectionType, "connectionType")                                                                                                                  \
    X(CloseOnExitMode, CloseOnExit, "closeOnExit", CloseOnExitMode::Automatic)                                                                                 \
    X(hstring, TabTitle, "tabTitle")                                                                                                                           \
    X(Model::BellStyle, BellStyle, "bellStyle", BellStyle::Audible)                                                                                            \
    X(IEnvironmentVariableMap, EnvironmentVariables, "environment", nullptr)                                                                                   \
    X(bool, RightClickContextMenu, "rightClickContextMenu", false)                                                                                             \
    X(Windows::Foundation::Collections::IVector<winrt::hstring>, BellSound, "bellSound", nullptr)                                                              \
    X(bool, Elevate, "elevate", false)                                                                                                                         \
    X(bool, AutoMarkPrompts, "autoMarkPrompts", true)                                                                                                          \
    X(bool, ShowMarks, "showMarksOnScrollbar", false)                                                                                                          \
    X(bool, RepositionCursorWithMouse, "experimental.repositionCursorWithMouse", false)                                                                        \
    X(bool, ReloadEnvironmentVariables, "compatibility.reloadEnvironmentVariables", true)                                                                      \
    X(bool, RainbowSuggestions, "experimental.rainbowSuggestions", false)

// Intentionally omitted Profile settings:
// * Name
// * Updates
// * Guid
// * Hidden
// * Source
// * Padding: needs special FromJson parsing
// * TabColor: is an optional setting, so needs to be set with INHERITABLE_NULLABLE_SETTING

#define MTSM_FONT_SETTINGS(X)                                                          \
    X(hstring, FontFace, "face", DEFAULT_FONT_FACE)                                    \
    X(float, FontSize, "size", DEFAULT_FONT_SIZE)                                      \
    X(winrt::Windows::UI::Text::FontWeight, FontWeight, "weight", DEFAULT_FONT_WEIGHT) \
    X(IFontAxesMap, FontAxes, "axes")                                                  \
    X(IFontFeatureMap, FontFeatures, "features")                                       \
    X(bool, EnableBuiltinGlyphs, "builtinGlyphs", true)                                \
    X(bool, EnableColorGlyphs, "colorGlyphs", true)                                    \
    X(winrt::hstring, CellWidth, "cellWidth")                                          \
    X(winrt::hstring, CellHeight, "cellHeight")

#define MTSM_APPEARANCE_SETTINGS(X)                                                                                                                                \
    X(Core::CursorStyle, CursorShape, "cursorShape", Core::CursorStyle::Bar)                                                                                       \
    X(uint32_t, CursorHeight, "cursorHeight", DEFAULT_CURSOR_HEIGHT)                                                                                               \
    X(float, BackgroundImageOpacity, "backgroundImageOpacity", 1.0f)                                                                                               \