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

Code before:
Copyright (c) Microsoft Corporation
Licensed under the MIT license.

Module Name:
- MTSMSettings.h

Abstract:
- Contains most of the settings within Terminal Settings Model (global, profile, font, appearance)
- To add a new setting to any one of those classes, simply add it to the respective list below, following the macro format

Author(s):
- Pankaj Bhojwani - October 2021

--*/
#pragma once

// Macro format (defaultArgs are optional):
// (type, name, jsonKey, defaultArgs)

#define MTSM_GLOBAL_SETTINGS(X)                                                                                                                            \
    X(int32_t, InitialRows, "initialRows", 30)                                                                                                             \
    X(int32_t, InitialCols, "initialCols", 80)                                                                                                             \
    X(hstring, WordDelimiters, "wordDelimiters", DEFAULT_WORD_DELIMITERS)                                                                                  \
    X(bool, CopyOnSelect, "copyOnSelect", false)                                                                                                           \
    X(bool, FocusFollowMouse, "focusFollowMouse", false)                                                                                                   \
    X(bool, UseAtlasEngine, "useAtlasEngine", Feature_AtlasEngine::IsEnabled())                                                                            \
    X(bool, ForceFullRepaintRendering, "experimental.rendering.forceFullRepaint", false)                                                                   \
    X(bool, SoftwareRendering, "experimental.rendering.software", false)                                                                                   \
    X(bool, UseBackgroundImageForWindow, "experimental.useBackgroundImageForWindow", false)                                                                \
    X(bool, ForceVTInput, "experimental.input.forceVT", false)                                                                                             \
    X(bool, TrimBlockSelection, "trimBlockSelection", true)                                                                                                \
    X(bool, DetectURLs, "experimental.detectURLs", true)                                                                                                   \
    X(bool, AlwaysShowTabs, "alwaysShowTabs", true)                                                                                                        \
    X(Model::NewTabPosition, NewTabPosition, "newTabPosition", Model::NewTabPosition::AfterLastTab)                                                        \
    X(bool, ShowTitleInTitlebar, "showTerminalTitleInTitlebar", true)                                                                                      \
    X(bool, ConfirmCloseAllTabs, "confirmCloseAllTabs", true)                                                                                              \
    X(hstring, Theme, "theme")                                                                                                                             \
    X(hstring, Language, "language")                                                                                                                       \
    X(winrt::Microsoft::UI::Xaml::Controls::TabViewWidthMode, TabWidthMode, "tabWidthMode", winrt::Microsoft::UI::Xaml::Controls::TabViewWidthMode::Equal) \
    X(bool, UseAcrylicInTabRow, "useAcrylicInTabRow", false)                                                                                               \
    X(bool, ShowTabsInTitlebar, "showTabsInTitlebar", true)                                                                                                \
    X(bool, InputServiceWarning, "inputServiceWarning", true)                                                                                              \
    X(winrt::Microsoft::Terminal::Control::CopyFormat, CopyFormatting, "copyFormatting", 0)                                                                \
    X(bool, WarnAboutLargePaste, "largePasteWarning", true)                                                                                                \
    X(bool, WarnAboutMultiLinePaste, "multiLinePasteWarning", true)                                                                                        \
    X(Model::LaunchPosition, InitialPosition, "initialPosition", nullptr, nullptr)                                                                         \
    X(bool, CenterOnLaunch, "centerOnLaunch", false)                                                                                                       \
    X(Model::FirstWindowPreference, FirstWindowPreference, "firstWindowPreference", FirstWindowPreference::DefaultProfile)                                 \
    X(Model::LaunchMode, LaunchMode, "launchMode", LaunchMode::DefaultMode)                                                                                \
    X(bool, SnapToGridOnResize, "snapToGridOnResize", true)                                                                                                \
    X(bool, DebugFeaturesEnabled, "debugFeatures", debugFeaturesDefault)                                                                                   \

Review comment (suggestion):
This was something I'd wanted to bring up for team discussion. I actually think we should move _away_ from global settings that impact individual `TermControl`s and gently push them towards `profiles.defaults`. 

Notes in chat. It may be better for our long-term vision; idk.

Code after:
Copyright (c) Microsoft Corporation
Licensed under the MIT license.

Module Name:
- MTSMSettings.h

Abstract:
- Contains most of the settings within Terminal Settings Model (global, profile, font, appearance)
- To add a new setting to any one of those classes, simply add it to the respective list below, following the macro format

Author(s):
- Pankaj Bhojwani - October 2021

--*/
#pragma once

// Macro format (defaultArgs are optional):
// (type, name, jsonKey, defaultArgs)

#define MTSM_GLOBAL_SETTINGS(X)                                                                                                                            \
    X(int32_t, InitialRows, "initialRows", 30)                                                                                                             \
    X(int32_t, InitialCols, "initialCols", 80)                                                                                                             \
    X(hstring, WordDelimiters, "wordDelimiters", DEFAULT_WORD_DELIMITERS)                                                                                  \
    X(bool, CopyOnSelect, "copyOnSelect", false)                                                                                                           \
    X(bool, FocusFollowMouse, "focusFollowMouse", false)                                                                                                   \
    X(bool, ForceFullRepaintRendering, "experimental.rendering.forceFullRepaint", false)                                                                   \
    X(bool, SoftwareRendering, "experimental.rendering.software", false)                                                                                   \
    X(bool, UseBackgroundImageForWindow, "experimental.useBackgroundImageForWindow", false)                                                                \
    X(bool, ForceVTInput, "experimental.input.forceVT", false)                                                                                             \
    X(bool, TrimBlockSelection, "trimBlockSelection", true)                                                                                                \
    X(bool, DetectURLs, "experimental.detectURLs", true)                                                                                                   \
    X(bool, AlwaysShowTabs, "alwaysShowTabs", true)                                                                                                        \
    X(Model::NewTabPosition, NewTabPosition, "newTabPosition", Model::NewTabPosition::AfterLastTab)                                                        \
    X(bool, ShowTitleInTitlebar, "showTerminalTitleInTitlebar", true)                                                                                      \
    X(bool, ConfirmCloseAllTabs, "confirmCloseAllTabs", true)                                                                                              \
    X(hstring, Theme, "theme")                                                                                                                             \
    X(hstring, Language, "language")                                                                                                                       \
    X(winrt::Microsoft::UI::Xaml::Controls::TabViewWidthMode, TabWidthMode, "tabWidthMode", winrt::Microsoft::UI::Xaml::Controls::TabViewWidthMode::Equal) \
    X(bool, UseAcrylicInTabRow, "useAcrylicInTabRow", false)                                                                                               \
    X(bool, ShowTabsInTitlebar, "showTabsInTitlebar", true)                                                                                                \
    X(bool, InputServiceWarning, "inputServiceWarning", true)                                                                                              \
    X(winrt::Microsoft::Terminal::Control::CopyFormat, CopyFormatting, "copyFormatting", 0)                                                                \
    X(bool, WarnAboutLargePaste, "largePasteWarning", true)                                                                                                \
    X(bool, WarnAboutMultiLinePaste, "multiLinePasteWarning", true)                                                                                        \
    X(Model::LaunchPosition, InitialPosition, "initialPosition", nullptr, nullptr)                                                                         \
    X(bool, CenterOnLaunch, "centerOnLaunch", false)                                                                                                       \
    X(Model::FirstWindowPreference, FirstWindowPreference, "firstWindowPreference", FirstWindowPreference::DefaultProfile)                                 \
    X(Model::LaunchMode, LaunchMode, "launchMode", LaunchMode::DefaultMode)                                                                                \
    X(bool, SnapToGridOnResize, "snapToGridOnResize", true)                                                                                                \
    X(bool, DebugFeaturesEnabled, "debugFeatures", debugFeaturesDefault)                                                                                   \
    X(bool, StartOnUserLogin, "startOnUserLogin", false)                                                                                                   \