Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add buttons for selecting commands, output to context menu #15020

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
eaf1a92
okay maybe I have silly free time ideas too
zadjii-msft Jul 23, 2022
7001e93
forwarded_event, string tests
zadjii-msft Jul 23, 2022
eb88cd3
practical use, look
zadjii-msft Jul 23, 2022
b535a5f
I suppose this is what happens when I have four uninterrupted hours a…
zadjii-msft Jul 23, 2022
520c89f
sad beeps
zadjii-msft Jul 23, 2022
eb7d2be
I am incapable of not making 100 tiny commits, this was already way t…
zadjii-msft Aug 13, 2022
e6b33c3
yea that's everything
zadjii-msft Aug 14, 2022
29d454b
90% plumbing, 10% bad implementation of making sure we right-clicked …
zadjii-msft Aug 28, 2022
451d8f3
move this code to interactivity. Scaling of event is wrong now
zadjii-msft Sep 19, 2022
99b84a6
Merge remote-tracking branch 'origin/main' into dev/migrie/f/3337-jus…
zadjii-msft Sep 20, 2022
dc2ebaf
use resource strings too. Last commit of stuff from before paternity …
zadjii-msft Oct 25, 2022
61a9c80
Migrate spelling-0.0.21 changes from main
DHowett Oct 25, 2022
5398ea3
mostly, the plumbing for this feature
zadjii-msft Dec 14, 2022
23f9527
this actually just selects the command+1 character
zadjii-msft Dec 14, 2022
dbb4db3
this gets the selection region actually correct
zadjii-msft Dec 14, 2022
d867a61
Add support for going up and down
zadjii-msft Dec 15, 2022
e76564e
this makes it _less_ painful
zadjii-msft Dec 15, 2022
ce6a2e7
you-donkey.png
zadjii-msft Dec 16, 2022
191bca8
Merge branch 'main' into dev/migrie/f/3337-just-for-funsies
zadjii-msft Jan 29, 2023
6a60053
a commandbarflyout intsead, with a slightly more idomatic implementation
zadjii-msft Feb 1, 2023
2dd01fb
open at the mouse
zadjii-msft Feb 1, 2023
2ee4111
adapt the previous action adder for the new menu
zadjii-msft Feb 2, 2023
854335b
cleanup; don't duplicate selection entries each time; open in the rig…
zadjii-msft Feb 2, 2023
0328b4f
icons, and dismiss the menu when the action's done
zadjii-msft Feb 2, 2023
08ae0ec
cleanup for review
zadjii-msft Feb 2, 2023
d6fe520
'cleanup
zadjii-msft Feb 2, 2023
7aef3af
bommand
zadjii-msft Feb 3, 2023
c77f959
PR nits
zadjii-msft Feb 5, 2023
ab55a8d
Revert "sad beeps"
zadjii-msft Feb 5, 2023
559ecdb
Revert "I suppose this is what happens when I have four uninterrupted…
zadjii-msft Feb 5, 2023
9ff0abe
Revert "practical use, look"
zadjii-msft Feb 5, 2023
564102b
Revert "forwarded_event, string tests"
zadjii-msft Feb 5, 2023
a1d5329
Revert "okay maybe I have silly free time ideas too"
zadjii-msft Feb 5, 2023
0e546a6
Merge remote-tracking branch 'origin/main' into dev/migrie/f/4588-sel…
zadjii-msft Feb 5, 2023
35b519a
use resorces
zadjii-msft Feb 7, 2023
2a6520d
cleanup
zadjii-msft Feb 7, 2023
77e4289
oh boy missed a pair
zadjii-msft Feb 7, 2023
d01cab3
Merge branch 'main' into dev/migrie/f/3337-just-for-funsies
zadjii-msft Feb 14, 2023
c4f3011
Merge branch 'main' into dev/migrie/f/4588-select-shell-output
zadjii-msft Mar 3, 2023
654baa7
most of the PR feedback
zadjii-msft Mar 3, 2023
23b46cb
Merge branch 'dev/migrie/f/3337-just-for-funsies' into dev/migrie/f/r…
zadjii-msft Mar 3, 2023
99e556b
Merge branch 'dev/migrie/f/4588-select-shell-output' into dev/migrie/…
zadjii-msft Mar 3, 2023
dde4e9e
This is a start. Selecting the output is almost always wrong and I do…
zadjii-msft Mar 3, 2023
449954e
This is better
zadjii-msft Mar 3, 2023
5a4f802
only show the menu when you've actually got shell integration enabled
zadjii-msft Mar 3, 2023
50d4683
I just love it so much
zadjii-msft Mar 3, 2023
eaae3ce
Merge branch 'main' into dev/migrie/f/4588-select-shell-output
zadjii-msft Mar 20, 2023
b2df084
Merge branch 'dev/migrie/f/4588-select-shell-output' of https://githu…
zadjii-msft Mar 20, 2023
e418751
Merge branch 'dev/migrie/f/4588-select-shell-output' into dev/migrie/…
zadjii-msft Mar 20, 2023
de3dada
Merge remote-tracking branch 'origin/main' into dev/migrie/f/4588-sel…
zadjii-msft Mar 24, 2023
7d17e6e
Merge branch 'dev/migrie/f/4588-select-shell-output' into dev/migrie/…
zadjii-msft Mar 24, 2023
52c4439
Merge remote-tracking branch 'origin/main' into dev/migrie/f/4588-sel…
zadjii-msft Apr 4, 2023
fe3ecb9
start working on a test
zadjii-msft Apr 5, 2023
9ec3d19
Merge branch 'dev/migrie/f/4588-select-shell-output' into dev/migrie/…
zadjii-msft Apr 5, 2023
275f3de
Fix the test to work as expected
zadjii-msft Apr 5, 2023
bd2e0b8
Fix the test to work as expected
zadjii-msft Apr 5, 2023
6ab1b6f
more tests
zadjii-msft Apr 5, 2023
cb03fb2
Merge branch 'dev/migrie/f/4588-select-shell-output' into dev/migrie/…
zadjii-msft Apr 5, 2023
3f91664
I suppose we don't need to reverse-iterate
zadjii-msft Apr 5, 2023
0be83bc
Merge remote-tracking branch 'origin/main' into dev/migrie/f/4588-sel…
zadjii-msft Apr 5, 2023
9016865
Merge branch 'dev/migrie/f/4588-select-shell-output' into dev/migrie/…
zadjii-msft Apr 5, 2023
fe2d54e
Merge remote-tracking branch 'origin/main' into dev/migrie/f/4588-sel…
zadjii-msft Apr 18, 2023
d5af16c
this was leonard's suggestion
zadjii-msft Apr 18, 2023
7c709cf
this is leonard's thing, for command output too
zadjii-msft Apr 19, 2023
e244b5e
Merge branch 'dev/migrie/f/4588-select-shell-output' into dev/migrie/…
zadjii-msft Apr 19, 2023
6cda6aa
Merge branch 'main' into dev/migrie/f/rclick-select-command
zadjii-msft Apr 20, 2023
242b318
Merge branch 'dev/migrie/f/rclick-select-command' of https://github.c…
zadjii-msft Apr 20, 2023
278e77f
Somehow, this returned
zadjii-msft Apr 20, 2023
7a95b13
start de-duping code
zadjii-msft Apr 21, 2023
30247c9
more deduplication for fun and profit
zadjii-msft Apr 21, 2023
d5347d0
Really trying my best to get rid of code duplication here
zadjii-msft Apr 24, 2023
de46ed8
this was apparently noexcept
zadjii-msft Apr 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 120 additions & 14 deletions src/cascadia/TerminalControl/ControlCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2182,10 +2182,21 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
}

void ControlCore::_selectSpan(til::point_span s)
{
const auto bufferSize{ _terminal->GetTextBuffer().GetSize() };
bufferSize.DecrementInBounds(s.end);

auto lock = _terminal->LockForWriting();
_terminal->SelectNewRegion(s.start, s.end);
_renderer->TriggerSelection();
}

void ControlCore::SelectCommand(const bool goUp)
{
const til::point start = HasSelection() ? (goUp ? _terminal->GetSelectionAnchor() : _terminal->GetSelectionEnd()) :
_terminal->GetTextBuffer().GetCursor().GetPosition();

std::optional<DispatchTypes::ScrollMark> nearest{ std::nullopt };
const auto& marks{ _terminal->GetScrollMarks() };

Expand Down Expand Up @@ -2217,20 +2228,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
{
const auto start = nearest->end;
auto end = *nearest->commandEnd;

const auto bufferSize{ _terminal->GetTextBuffer().GetSize() };
bufferSize.DecrementInBounds(end);

auto lock = _terminal->LockForWriting();
_terminal->SelectNewRegion(start, end);
_renderer->TriggerSelection();
_selectSpan(til::point_span{ start, end });
}
}

void ControlCore::SelectOutput(const bool goUp)
{
const til::point start = HasSelection() ? (goUp ? _terminal->GetSelectionAnchor() : _terminal->GetSelectionEnd()) :
_terminal->GetTextBuffer().GetCursor().GetPosition();

std::optional<DispatchTypes::ScrollMark> nearest{ std::nullopt };
const auto& marks{ _terminal->GetScrollMarks() };

Expand All @@ -2256,13 +2262,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
{
const auto start = *nearest->commandEnd;
auto end = *nearest->outputEnd;

const auto bufferSize{ _terminal->GetTextBuffer().GetSize() };
bufferSize.DecrementInBounds(end);

auto lock = _terminal->LockForWriting();
_terminal->SelectNewRegion(start, end);
_renderer->TriggerSelection();
_selectSpan(til::point_span{ start, end });
}
}

Expand Down Expand Up @@ -2301,4 +2301,110 @@ namespace winrt::Microsoft::Terminal::Control::implementation
}
}
}

void ControlCore::AnchorContextMenu(const til::point viewportRelativeCharacterPosition)
{
// viewportRelativeCharacterPosition is relative to the current
// viewport, so adjust for that:
_contextMenuBufferPosition = _terminal->GetViewport().Origin() + viewportRelativeCharacterPosition;
}

void ControlCore::_contextMenuSelectMark(
const til::point& pos,
const std::function<bool(const DispatchTypes::ScrollMark&)>& filter,
const std::function<til::point_span(const DispatchTypes::ScrollMark&)>& getSpan)
Comment on lines +2314 to +2315
Copy link
Member

@lhecker lhecker Apr 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can also be achieved using regular function pointers like so:

void ControlCore::_contextMenuSelectMark(
    const til::point& pos,
    bool(*)(const DispatchTypes::ScrollMark&) filter,
    til::point_span(*)(const DispatchTypes::ScrollMark&) getSpan
)

The remaining code should still compile the same. This makes it easier on the compiler (std::function is a very large, very very complex template, has lots of exception handling routines and is 64 bytes large) and easier on the debugger, which will have a very easy time tracing raw function pointers.

If you'd like to I'd be happy to help you with such a change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming these comments went unaddressed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops sorry, fixed in #15233

{
// Do nothing if the caller didn't give us a way to get the span to select for this mark.
if (!getSpan)
{
return;
}
Comment on lines +2317 to +2321
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just write __assume(getSpan) if the compiler is complaining.

const auto& marks{ _terminal->GetScrollMarks() };
for (auto&& m : marks)
zadjii-msft marked this conversation as resolved.
Show resolved Hide resolved
{
// If the caller gave us a way to filter marks, check that now.
// This can be used to filter to only marks that have a command, or output.
if (filter && filter(m))
{
continue;
}
// If they clicked _anywhere_ in the mark...
const auto [markStart, markEnd] = m.GetExtent();
if (markStart <= pos &&
markEnd >= pos)
{
// ... select the part of the mark the caller told us about.
_selectSpan(getSpan(m));
// And quick bail
return;
}
}
}

void ControlCore::ContextMenuSelectCommand()
{
_contextMenuSelectMark(
_contextMenuBufferPosition,
[](const DispatchTypes::ScrollMark& m) -> bool { return !m.HasCommand(); },
[](const DispatchTypes::ScrollMark& m) { return til::point_span{ m.end, *m.commandEnd }; });
}
void ControlCore::ContextMenuSelectOutput()
{
_contextMenuSelectMark(
_contextMenuBufferPosition,
[](const DispatchTypes::ScrollMark& m) -> bool { return !m.HasOutput(); },
[](const DispatchTypes::ScrollMark& m) { return til::point_span{ *m.commandEnd, *m.outputEnd }; });
}

bool ControlCore::_clickedOnMark(
const til::point& pos,
const std::function<bool(const DispatchTypes::ScrollMark&)>& filter)
{
// Don't show this if the click was on the selection
if (_terminal->IsSelectionActive() &&
_terminal->GetSelectionAnchor() <= pos &&
_terminal->GetSelectionEnd() >= pos)
{
return false;
}

// DO show this if the click was on a mark with a command
const auto& marks{ _terminal->GetScrollMarks() };
for (auto&& m : marks)
zadjii-msft marked this conversation as resolved.
Show resolved Hide resolved
{
if (filter && filter(m))
{
continue;
}
const auto [start, end] = m.GetExtent();
if (start <= pos &&
end >= pos)
{
return true;
}
}

// Didn't click on a mark with a command - don't show.
return false;
}

// Method Description:
// * Don't show this if the click was on the _current_ selection
// * Don't show this if the click wasn't on a mark with at least a command
// * Otherwise yea, show it.
bool ControlCore::ShouldShowSelectCommand()
{
// Relies on the anchor set in AnchorContextMenu
return _clickedOnMark(_contextMenuBufferPosition,
[](const DispatchTypes::ScrollMark& m) -> bool { return !m.HasCommand(); });
}

// Method Description:
// * Same as ShouldShowSelectCommand, but with the mark needing output
bool ControlCore::ShouldShowSelectOutput()
{
// Relies on the anchor set in AnchorContextMenu
return _clickedOnMark(_contextMenuBufferPosition,
[](const DispatchTypes::ScrollMark& m) -> bool { return !m.HasOutput(); });
}
}
20 changes: 20 additions & 0 deletions src/cascadia/TerminalControl/ControlCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation
void ClearMark();
void ClearAllMarks();
void ScrollToMark(const Control::ScrollToMarkDirection& direction);

void SelectCommand(const bool goUp);
void SelectOutput(const bool goUp);

void ContextMenuSelectCommand();
void ContextMenuSelectOutput();
#pragma endregion

#pragma region ITerminalInput
Expand Down Expand Up @@ -220,6 +224,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
uint64_t OwningHwnd();
void OwningHwnd(uint64_t owner);

void AnchorContextMenu(til::point viewportRelativeCharacterPosition);

bool ShouldShowSelectCommand();
bool ShouldShowSelectOutput();

RUNTIME_SETTING(double, Opacity, _settings->Opacity());
RUNTIME_SETTING(bool, UseAcrylic, _settings->UseAcrylic());

Expand Down Expand Up @@ -304,6 +313,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation
std::unique_ptr<til::throttled_func_trailing<>> _updatePatternLocations;
std::shared_ptr<ThrottledFuncTrailing<Control::ScrollPositionChangedArgs>> _updateScrollBar;

til::point _contextMenuBufferPosition{ 0, 0 };

void _setupDispatcherAndCallbacks();

bool _setFontSizeUnderLock(float fontSize);
Expand Down Expand Up @@ -349,6 +360,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
bool _isBackgroundTransparent();
void _focusChanged(bool focused);

void _selectSpan(til::point_span s);

void _contextMenuSelectMark(
const til::point& pos,
const std::function<bool(const ::Microsoft::Console::VirtualTerminal::DispatchTypes::ScrollMark&)>& filter,
const std::function<til::point_span(const ::Microsoft::Console::VirtualTerminal::DispatchTypes::ScrollMark&)>& getSpan);

bool _clickedOnMark(const til::point& pos, const std::function<bool(const ::Microsoft::Console::VirtualTerminal::DispatchTypes::ScrollMark&)>& filter);

inline bool _IsClosing() const noexcept
{
#ifndef NDEBUG
Expand Down
5 changes: 5 additions & 0 deletions src/cascadia/TerminalControl/ControlCore.idl
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ namespace Microsoft.Terminal.Control

void ColorSelection(SelectionColor fg, SelectionColor bg, Microsoft.Terminal.Core.MatchMode matchMode);

void ContextMenuSelectCommand();
void ContextMenuSelectOutput();
Boolean ShouldShowSelectCommand();
Boolean ShouldShowSelectOutput();

event FontSizeChangedEventArgs FontSizeChanged;

event Windows.Foundation.TypedEventHandler<Object, CopyToClipboardEventArgs> CopyToClipboard;
Expand Down
5 changes: 5 additions & 0 deletions src/cascadia/TerminalControl/ControlInteractivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ namespace winrt::Microsoft::Terminal::Control::implementation
{
if (_core->Settings().RightClickContextMenu())
{
// Let the core know we're about to open a menu here. It has
// some separate conditional logic based on _where_ the user
// wanted to open the menu.
_core->AnchorContextMenu(terminalPosition);

auto contextArgs = winrt::make<ContextMenuRequestedEventArgs>(til::point{ pixelPosition }.to_winrt_point());
_ContextMenuRequestedHandlers(*this, contextArgs);
}
Expand Down
32 changes: 32 additions & 0 deletions src/cascadia/TerminalControl/Resources/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,36 @@ Please either install the missing font or choose another one.</value>
<value>Find</value>
<comment>The tooltip for a button for searching for the selected text</comment>
</data>
<data name="SelectCommandButton.Label" xml:space="preserve">
<value>Select command</value>
<comment>The label of a button for selecting all of the text of a command</comment>
</data>
<data name="SelectCommandButton.ToolTipService.ToolTip" xml:space="preserve">
<value>Select command</value>
<comment>The tooltip for a button for selecting all of the text of a command</comment>
</data>
<data name="SelectOutputButton.Label" xml:space="preserve">
<value>Select output</value>
<comment>The label of a button for selecting all of a command's output</comment>
</data>
<data name="SelectOutputButton.ToolTipService.ToolTip" xml:space="preserve">
<value>Select output</value>
<comment>The tooltip for a button for selecting all of a command's output</comment>
</data>
<data name="SelectCommandWithSelectionButton.Label" xml:space="preserve">
<value>Select command</value>
<comment>The label of a button for selecting all of the text of a command</comment>
</data>
<data name="SelectCommandWithSelectionButton.ToolTipService.ToolTip" xml:space="preserve">
<value>Select command</value>
<comment>The tooltip for a button for selecting all of the text of a command</comment>
</data>
<data name="SelectOutputWithSelectionButton.Label" xml:space="preserve">
<value>Select output</value>
<comment>The label of a button for selecting all of a command's output</comment>
</data>
<data name="SelectOutputWithSelectionButton.ToolTipService.ToolTip" xml:space="preserve">
<value>Select output</value>
<comment>The tooltip for a button for selecting all of a command's output</comment>
</data>
</root>
24 changes: 24 additions & 0 deletions src/cascadia/TerminalControl/TermControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3350,6 +3350,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
const auto pos = (absolutePointerPos - absoluteWindowOrigin - controlOrigin).to_winrt_point();
myOption.Position(pos);

// The "Select command" and "Select output" buttons should only be
// visible if shell integration is actually turned on.
const auto shouldShowSelectCommand{ _core.ShouldShowSelectCommand() };
const auto shouldShowSelectOutput{ _core.ShouldShowSelectOutput() };
SelectCommandButton().Visibility(shouldShowSelectCommand ? Visibility::Visible : Visibility::Collapsed);
SelectOutputButton().Visibility(shouldShowSelectOutput ? Visibility::Visible : Visibility::Collapsed);
SelectCommandWithSelectionButton().Visibility(shouldShowSelectCommand ? Visibility::Visible : Visibility::Collapsed);
SelectOutputWithSelectionButton().Visibility(shouldShowSelectOutput ? Visibility::Visible : Visibility::Collapsed);

(_core.HasSelection() ? SelectionContextMenu() :
ContextMenu())
.ShowAt(*this, myOption);
Expand Down Expand Up @@ -3378,4 +3387,19 @@ namespace winrt::Microsoft::Terminal::Control::implementation
SearchMatch(false);
}

void TermControl::_SelectCommandHandler(const IInspectable& /*sender*/,
const IInspectable& /*args*/)
{
ContextMenu().Hide();
SelectionContextMenu().Hide();
_core.ContextMenuSelectCommand();
}

void TermControl::_SelectOutputHandler(const IInspectable& /*sender*/,
const IInspectable& /*args*/)
{
ContextMenu().Hide();
SelectionContextMenu().Hide();
_core.ContextMenuSelectOutput();
}
}
11 changes: 7 additions & 4 deletions src/cascadia/TerminalControl/TermControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ namespace winrt::Microsoft::Terminal::Control::implementation
bool _isBackgroundLight{ false };
bool _detached{ false };

winrt::Windows::Foundation::Collections::IObservableVector<winrt::Windows::UI::Xaml::Controls::ICommandBarElement> _originalPrimaryElements{ nullptr };
winrt::Windows::Foundation::Collections::IObservableVector<winrt::Windows::UI::Xaml::Controls::ICommandBarElement> _originalSecondaryElements{ nullptr };
winrt::Windows::Foundation::Collections::IObservableVector<winrt::Windows::UI::Xaml::Controls::ICommandBarElement> _originalSelectedPrimaryElements{ nullptr };
winrt::Windows::Foundation::Collections::IObservableVector<winrt::Windows::UI::Xaml::Controls::ICommandBarElement> _originalSelectedSecondaryElements{ nullptr };
Windows::Foundation::Collections::IObservableVector<Windows::UI::Xaml::Controls::ICommandBarElement> _originalPrimaryElements{ nullptr };
Windows::Foundation::Collections::IObservableVector<Windows::UI::Xaml::Controls::ICommandBarElement> _originalSecondaryElements{ nullptr };
Windows::Foundation::Collections::IObservableVector<Windows::UI::Xaml::Controls::ICommandBarElement> _originalSelectedPrimaryElements{ nullptr };
Windows::Foundation::Collections::IObservableVector<Windows::UI::Xaml::Controls::ICommandBarElement> _originalSelectedSecondaryElements{ nullptr };

inline bool _IsClosing() const noexcept
{
Expand Down Expand Up @@ -347,6 +347,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation
void _CopyCommandHandler(const IInspectable& sender, const IInspectable& args);
void _SearchCommandHandler(const IInspectable& sender, const IInspectable& args);

void _SelectCommandHandler(const IInspectable& sender, const IInspectable& args);
void _SelectOutputHandler(const IInspectable& sender, const IInspectable& args);

struct Revokers
{
Control::ControlCore::ScrollPositionChanged_revoker coreScrollPositionChanged;
Expand Down
28 changes: 28 additions & 0 deletions src/cascadia/TerminalControl/TermControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@
x:Uid="PasteCommandButton"
Click="_PasteCommandHandler"
Icon="Paste" />
<mux:CommandBarFlyout.SecondaryCommands>
<AppBarButton x:Name="SelectCommandButton"
x:Uid="SelectCommandButton"
Click="_SelectCommandHandler">
<AppBarButton.Icon>
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="11"
Glyph="&#xE756;" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton x:Name="SelectOutputButton"
x:Uid="SelectOutputButton"
Click="_SelectOutputHandler"
Icon="AlignLeft" />
</mux:CommandBarFlyout.SecondaryCommands>
</mux:CommandBarFlyout>

<mux:CommandBarFlyout x:Name="SelectionContextMenu">
Expand All @@ -53,6 +68,19 @@
x:Uid="SearchCommandButton"
Click="_SearchCommandHandler"
Icon="Find" />
<AppBarButton x:Name="SelectCommandWithSelectionButton"
x:Uid="SelectCommandWithSelectionButton"
Click="_SelectCommandHandler">
<AppBarButton.Icon>
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="11"
Glyph="&#xE756;" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton x:Name="SelectOutputWithSelectionButton"
x:Uid="SelectOutputWithSelectionButton"
Click="_SelectOutputHandler"
Icon="AlignLeft" />
</mux:CommandBarFlyout.SecondaryCommands>
</mux:CommandBarFlyout>

Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalSettingsModel/ActionArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
namespace winrt::Microsoft::Terminal::Settings::Model::factory_implementation
{
BASIC_FACTORY(ActionEventArgs);
BASIC_FACTORY(CopyTextArgs);
BASIC_FACTORY(SwitchToTabArgs);
BASIC_FACTORY(NewTerminalArgs);
BASIC_FACTORY(NewTabArgs);
Expand Down
Loading