Skip to content

Commit b9a0cae

Browse files
authored
Add a pile of 'experimental' settings to the profile SUI (#16809)
As noted in #3337, we never actually added this menu to the settings. Since we're planning on taking this out of "experimental" in 1.21, we should have a visible setting for it too.
1 parent 0a83946 commit b9a0cae

File tree

6 files changed

+100
-1
lines changed

6 files changed

+100
-1
lines changed

src/cascadia/TerminalControl/TermControl.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation
333333
// (The window has a min. size that ensures that there's always a scrollbar thumb.)
334334
if (drawableRange < 0)
335335
{
336-
assert(false);
337336
return;
338337
}
339338

src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,18 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
302302
{
303303
return Feature_VtPassthroughMode::IsEnabled() && Feature_VtPassthroughModeSettingInUI::IsEnabled();
304304
}
305+
bool ProfileViewModel::ShowMarksAvailable() const noexcept
306+
{
307+
return Feature_ScrollbarMarks::IsEnabled();
308+
}
309+
bool ProfileViewModel::AutoMarkPromptsAvailable() const noexcept
310+
{
311+
return Feature_ScrollbarMarks::IsEnabled();
312+
}
313+
bool ProfileViewModel::RepositionCursorWithMouseAvailable() const noexcept
314+
{
315+
return Feature_ScrollbarMarks::IsEnabled();
316+
}
305317

306318
bool ProfileViewModel::UseParentProcessDirectory()
307319
{

src/cascadia/TerminalSettingsEditor/ProfileViewModel.h

+8
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
8181
bool ShowUnfocusedAppearance();
8282
void CreateUnfocusedAppearance();
8383
void DeleteUnfocusedAppearance();
84+
8485
bool VtPassthroughAvailable() const noexcept;
86+
bool ShowMarksAvailable() const noexcept;
87+
bool AutoMarkPromptsAvailable() const noexcept;
88+
bool RepositionCursorWithMouseAvailable() const noexcept;
8589

8690
til::typed_event<Editor::ProfileViewModel, Editor::DeleteProfileEventArgs> DeleteProfileRequested;
8791

@@ -115,6 +119,10 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
115119
OBSERVABLE_PROJECTED_SETTING(_profile, Elevate);
116120
OBSERVABLE_PROJECTED_SETTING(_profile, VtPassthrough);
117121
OBSERVABLE_PROJECTED_SETTING(_profile, ReloadEnvironmentVariables);
122+
OBSERVABLE_PROJECTED_SETTING(_profile, RightClickContextMenu);
123+
OBSERVABLE_PROJECTED_SETTING(_profile, ShowMarks);
124+
OBSERVABLE_PROJECTED_SETTING(_profile, AutoMarkPrompts);
125+
OBSERVABLE_PROJECTED_SETTING(_profile, RepositionCursorWithMouse);
118126

119127
WINRT_PROPERTY(bool, IsBaseLayer, false);
120128
WINRT_PROPERTY(bool, FocusDeleteButton, false);

src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl

+8
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ namespace Microsoft.Terminal.Settings.Editor
7474
Boolean EditableUnfocusedAppearance { get; };
7575
Boolean ShowUnfocusedAppearance { get; };
7676
AppearanceViewModel UnfocusedAppearance { get; };
77+
7778
Boolean VtPassthroughAvailable { get; };
79+
Boolean ShowMarksAvailable { get; };
80+
Boolean AutoMarkPromptsAvailable { get; };
81+
Boolean RepositionCursorWithMouseAvailable { get; };
7882

7983
String EvaluatedIcon { get; };
8084

@@ -109,5 +113,9 @@ namespace Microsoft.Terminal.Settings.Editor
109113
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, Elevate);
110114
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, VtPassthrough);
111115
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, ReloadEnvironmentVariables);
116+
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, RightClickContextMenu);
117+
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, ShowMarks);
118+
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, AutoMarkPrompts);
119+
OBSERVABLE_PROJECTED_PROFILE_SETTING(Boolean, RepositionCursorWithMouse);
112120
}
113121
}

src/cascadia/TerminalSettingsEditor/Profiles_Advanced.xaml

+40
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,35 @@
127127
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
128128
</local:SettingContainer>
129129

130+
<!-- RightClickContextMenu -->
131+
<local:SettingContainer x:Uid="Profile_RightClickContextMenu"
132+
ClearSettingValue="{x:Bind Profile.ClearRightClickContextMenu}"
133+
HasSettingValue="{x:Bind Profile.HasRightClickContextMenu, Mode=OneWay}"
134+
SettingOverrideSource="{x:Bind Profile.RightClickContextMenuOverrideSource, Mode=OneWay}">
135+
<ToggleSwitch IsOn="{x:Bind Profile.RightClickContextMenu, Mode=TwoWay}"
136+
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
137+
</local:SettingContainer>
138+
139+
<!-- ShowMarks -->
140+
<local:SettingContainer x:Uid="Profile_ShowMarks"
141+
ClearSettingValue="{x:Bind Profile.ClearShowMarks}"
142+
HasSettingValue="{x:Bind Profile.HasShowMarks, Mode=OneWay}"
143+
SettingOverrideSource="{x:Bind Profile.ShowMarksOverrideSource, Mode=OneWay}"
144+
Visibility="{x:Bind Profile.ShowMarksAvailable}">
145+
<ToggleSwitch IsOn="{x:Bind Profile.ShowMarks, Mode=TwoWay}"
146+
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
147+
</local:SettingContainer>
148+
149+
<!-- AutoMarkPrompts -->
150+
<local:SettingContainer x:Uid="Profile_AutoMarkPrompts"
151+
ClearSettingValue="{x:Bind Profile.ClearAutoMarkPrompts}"
152+
HasSettingValue="{x:Bind Profile.HasAutoMarkPrompts, Mode=OneWay}"
153+
SettingOverrideSource="{x:Bind Profile.AutoMarkPromptsOverrideSource, Mode=OneWay}"
154+
Visibility="{x:Bind Profile.AutoMarkPromptsAvailable}">
155+
<ToggleSwitch IsOn="{x:Bind Profile.AutoMarkPrompts, Mode=TwoWay}"
156+
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
157+
</local:SettingContainer>
158+
130159
<!-- ReloadEnvVars -->
131160
<local:SettingContainer x:Uid="Profile_ReloadEnvVars"
132161
ClearSettingValue="{x:Bind Profile.ClearReloadEnvironmentVariables}"
@@ -135,6 +164,17 @@
135164
<ToggleSwitch IsOn="{x:Bind Profile.ReloadEnvironmentVariables, Mode=TwoWay}"
136165
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
137166
</local:SettingContainer>
167+
168+
<!-- RepositionCursorWithMouse -->
169+
<local:SettingContainer x:Uid="Profile_RepositionCursorWithMouse"
170+
ClearSettingValue="{x:Bind Profile.ClearRepositionCursorWithMouse}"
171+
HasSettingValue="{x:Bind Profile.HasRepositionCursorWithMouse, Mode=OneWay}"
172+
SettingOverrideSource="{x:Bind Profile.RepositionCursorWithMouseOverrideSource, Mode=OneWay}"
173+
Visibility="{x:Bind Profile.RepositionCursorWithMouseAvailable}">
174+
<ToggleSwitch IsOn="{x:Bind Profile.RepositionCursorWithMouse, Mode=TwoWay}"
175+
Style="{StaticResource ToggleSwitchInExpanderStyle}" />
176+
</local:SettingContainer>
177+
138178
</StackPanel>
139179
</Grid>
140180
</Page>

src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw

+32
Original file line numberDiff line numberDiff line change
@@ -1218,6 +1218,38 @@
12181218
<value>Enable experimental virtual terminal passthrough</value>
12191219
<comment>An option to enable experimental virtual terminal passthrough connectivity option with the underlying ConPTY</comment>
12201220
</data>
1221+
<data name="Profile_RightClickContextMenu.Header" xml:space="preserve">
1222+
<value>Display a menu on right-click</value>
1223+
<comment>This controls how a right-click behaves in the terminal</comment>
1224+
</data>
1225+
<data name="Profile_RightClickContextMenu.HelpText" xml:space="preserve">
1226+
<value>When enabled, the Terminal will display a menu on right-click. When disabled, right-clicking will copy the selected text (or paste if there's no selection).</value>
1227+
<comment>A description for what the "Display a menu on right-click" setting does. Presented near "Profile_RightClickContextMenu".</comment>
1228+
</data>
1229+
<data name="Profile_ShowMarks.Header" xml:space="preserve">
1230+
<value>Display marks on the scrollbar</value>
1231+
<comment>"Marks" are small visual indicators that can help the user identify the position of useful info in the scrollbar</comment>
1232+
</data>
1233+
<data name="Profile_ShowMarks.HelpText" xml:space="preserve">
1234+
<value>When enabled, the Terminal will display marks in the scrollbar when searching for text, or when shell integration is enabled.</value>
1235+
<comment>A description for what the "Display marks on the scrollbar" setting does. Presented near "Profile_ShowMarks".</comment>
1236+
</data>
1237+
<data name="Profile_AutoMarkPrompts.Header" xml:space="preserve">
1238+
<value>Automatically mark prompts on pressing Enter</value>
1239+
<comment>"Enter" is the enter/return key on the keyboard. This will add a mark indicating the position of a shell prompt when the user presses enter.</comment>
1240+
</data>
1241+
<data name="Profile_AutoMarkPrompts.HelpText" xml:space="preserve">
1242+
<value>When enabled, the Terminal automatically add a mark indicating the position of the end of the command when you press enter.</value>
1243+
<comment>A description for what the "Automatically mark prompts on pressing Enter" setting does. Presented near "Profile_AutoMarkPrompts".</comment>
1244+
</data>
1245+
<data name="Profile_RepositionCursorWithMouse.Header" xml:space="preserve">
1246+
<value>Experimental: Reposition the cursor with mouse clicks</value>
1247+
<comment>This allows the user to move the text cursor just by clicking with the mouse.</comment>
1248+
</data>
1249+
<data name="Profile_RepositionCursorWithMouse.HelpText" xml:space="preserve">
1250+
<value>When enabled, clicking inside the prompt will move the cursor to that position. This requires shell integration to be enabled in your shell to work as expected.</value>
1251+
<comment>A description for what the "Reload environment variables" setting does. Presented near "Profile_RepositionCursorWithMouse".</comment>
1252+
</data>
12211253
<data name="Profile_BellStyleAudible.Content" xml:space="preserve">
12221254
<value>Audible</value>
12231255
<comment>An option to choose from for the "bell style" setting. When selected, an audible cue is used to notify the user.</comment>

0 commit comments

Comments
 (0)