Skip to content

Commit 2f8b947

Browse files
committed
Revert "Add 'copyFormatting' global setting (#5263)"
This reverts commit c55d9cd.
1 parent c55d9cd commit 2f8b947

File tree

5 files changed

+10
-32
lines changed

5 files changed

+10
-32
lines changed

doc/cascadia/SettingsSchema.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Properties listed below affect the entire window, regardless of the profile sett
77
| -------- | --------- | ---- | ------- | ----------- |
88
| `alwaysShowTabs` | _Required_ | Boolean | `true` | When set to `true`, tabs are always displayed. When set to `false` and `showTabsInTitlebar` is set to `false`, tabs only appear after typing <kbd>Ctrl</kbd> + <kbd>T</kbd>. |
99
| `copyOnSelect` | Optional | Boolean | `false` | When set to `true`, a selection is immediately copied to your clipboard upon creation. When set to `false`, the selection persists and awaits further action. |
10-
| `copyFormatting` | Optional | Boolean | `false` | When set to `true`, the color and font formatting of selected text is also copied to your clipboard. When set to `false`, only plain text is copied to your clipboard. |
1110
| `defaultProfile` | _Required_ | String | PowerShell guid | Sets the default profile. Opens by typing <kbd>Ctrl</kbd> + <kbd>T</kbd> or by clicking the '+' icon. The guid of the desired default profile is used as the value. |
1211
| `initialCols` | _Required_ | Integer | `120` | The number of columns displayed in the window upon first load. |
1312
| `initialPosition` | Optional | String | `","` | The position of the top left corner of the window upon first load. On a system with multiple displays, these coordinates are relative to the top left of the primary display. If `launchMode` is set to `"maximized"`, the window will be maximized on the monitor specified by those coordinates. |

doc/cascadia/profiles.schema.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,6 @@
277277
"description": "When set to true, a selection is immediately copied to your clipboard upon creation. When set to false, the selection persists and awaits further action.",
278278
"type": "boolean"
279279
},
280-
"copyFormatting": {
281-
"default": false,
282-
"description": "When set to `true`, the color and font formatting of selected text is also copied to your clipboard. When set to `false`, only plain text is copied to your clipboard.",
283-
"type": "boolean"
284-
},
285280
"defaultProfile": {
286281
"$ref": "#/definitions/ProfileGuid",
287282
"description": "Sets the default profile. Opens by clicking the '+' icon or typing the key binding assigned to 'newTab'. The guid of the desired default profile is used as the value."

src/cascadia/TerminalApp/GlobalAppSettings.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ static constexpr std::wstring_view TitleLengthTabWidthModeValue{ L"titleLength"
3232
static constexpr std::string_view ShowTabsInTitlebarKey{ "showTabsInTitlebar" };
3333
static constexpr std::string_view WordDelimitersKey{ "wordDelimiters" };
3434
static constexpr std::string_view CopyOnSelectKey{ "copyOnSelect" };
35-
static constexpr std::string_view CopyFormattingKey{ "copyFormatting" };
3635
static constexpr std::string_view LaunchModeKey{ "launchMode" };
3736
static constexpr std::string_view ConfirmCloseAllKey{ "confirmCloseAllTabs" };
3837
static constexpr std::string_view SnapToGridOnResizeKey{ "snapToGridOnResize" };
@@ -68,7 +67,6 @@ GlobalAppSettings::GlobalAppSettings() :
6867
_tabWidthMode{ TabViewWidthMode::Equal },
6968
_wordDelimiters{ DEFAULT_WORD_DELIMITERS },
7069
_copyOnSelect{ false },
71-
_copyFormatting{ false },
7270
_launchMode{ LaunchMode::DefaultMode },
7371
_debugFeatures{ debugFeaturesDefault }
7472
{
@@ -163,11 +161,6 @@ void GlobalAppSettings::SetCopyOnSelect(const bool copyOnSelect) noexcept
163161
_copyOnSelect = copyOnSelect;
164162
}
165163

166-
bool GlobalAppSettings::GetCopyFormatting() const noexcept
167-
{
168-
return _copyFormatting;
169-
}
170-
171164
LaunchMode GlobalAppSettings::GetLaunchMode() const noexcept
172165
{
173166
return _launchMode;
@@ -252,7 +245,6 @@ Json::Value GlobalAppSettings::ToJson() const
252245
jsonObject[JsonKey(ShowTabsInTitlebarKey)] = _showTabsInTitlebar;
253246
jsonObject[JsonKey(WordDelimitersKey)] = winrt::to_string(_wordDelimiters);
254247
jsonObject[JsonKey(CopyOnSelectKey)] = _copyOnSelect;
255-
jsonObject[JsonKey(CopyFormattingKey)] = _copyFormatting;
256248
jsonObject[JsonKey(LaunchModeKey)] = winrt::to_string(_SerializeLaunchMode(_launchMode));
257249
jsonObject[JsonKey(ThemeKey)] = winrt::to_string(_SerializeTheme(_theme));
258250
jsonObject[JsonKey(TabWidthModeKey)] = winrt::to_string(_SerializeTabWidthMode(_tabWidthMode));
@@ -319,8 +311,6 @@ void GlobalAppSettings::LayerJson(const Json::Value& json)
319311

320312
JsonUtils::GetBool(json, CopyOnSelectKey, _copyOnSelect);
321313

322-
JsonUtils::GetBool(json, CopyFormattingKey, _copyFormatting);
323-
324314
if (auto launchMode{ json[JsonKey(LaunchModeKey)] })
325315
{
326316
_launchMode = _ParseLaunchMode(GetWstringFromJson(launchMode));

src/cascadia/TerminalApp/GlobalAppSettings.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ class TerminalApp::GlobalAppSettings final
6868
bool GetCopyOnSelect() const noexcept;
6969
void SetCopyOnSelect(const bool copyOnSelect) noexcept;
7070

71-
bool GetCopyFormatting() const noexcept;
72-
7371
std::optional<int32_t> GetInitialX() const noexcept;
7472

7573
std::optional<int32_t> GetInitialY() const noexcept;
@@ -112,7 +110,6 @@ class TerminalApp::GlobalAppSettings final
112110
bool _showTabsInTitlebar;
113111
std::wstring _wordDelimiters;
114112
bool _copyOnSelect;
115-
bool _copyFormatting;
116113
winrt::Windows::UI::Xaml::ElementTheme _theme;
117114
winrt::Microsoft::UI::Xaml::Controls::TabViewWidthMode _tabWidthMode;
118115

src/cascadia/TerminalApp/TerminalPage.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,21 +1310,18 @@ namespace winrt::TerminalApp::implementation
13101310
// copy text to dataPack
13111311
dataPack.SetText(copiedData.Text());
13121312

1313-
if (_settings->GlobalSettings().GetCopyFormatting())
1313+
// copy html to dataPack
1314+
const auto htmlData = copiedData.Html();
1315+
if (!htmlData.empty())
13141316
{
1315-
// copy html to dataPack
1316-
const auto htmlData = copiedData.Html();
1317-
if (!htmlData.empty())
1318-
{
1319-
dataPack.SetHtmlFormat(htmlData);
1320-
}
1317+
dataPack.SetHtmlFormat(htmlData);
1318+
}
13211319

1322-
// copy rtf data to dataPack
1323-
const auto rtfData = copiedData.Rtf();
1324-
if (!rtfData.empty())
1325-
{
1326-
dataPack.SetRtf(rtfData);
1327-
}
1320+
// copy rtf data to dataPack
1321+
const auto rtfData = copiedData.Rtf();
1322+
if (!rtfData.empty())
1323+
{
1324+
dataPack.SetRtf(rtfData);
13281325
}
13291326

13301327
try

0 commit comments

Comments
 (0)