fix conflicts with #11625

This commit is contained in:
Mike Griese 2021-11-11 11:38:50 -06:00
parent a338ca168c
commit 8532dd692e
5 changed files with 25 additions and 1 deletions

View file

@ -642,4 +642,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
return _core->GetUiaData();
}
// Method Description:
// - Used by the TermControl to know if it should translate drag-dropped
// paths into WSL-friendly paths.
// Arguments:
// - <none>
// Return Value:
// - true if the connection we were created with was a WSL profile.
bool ControlInteractivity::ManglePathsForWsl()
{
return _core->Settings().ProfileSource() == L"Windows.Terminal.Wsl";
}
}

View file

@ -83,6 +83,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation
const Windows::Foundation::IReference<CopyFormat>& formats);
void RequestPasteTextFromClipboard();
void SetEndSelectionPoint(const til::point pixelPosition);
bool ManglePathsForWsl();
TYPED_EVENT(OpenHyperlink, IInspectable, Control::OpenHyperlinkEventArgs);
TYPED_EVENT(PasteFromClipboard, IInspectable, Control::PasteFromClipboardEventArgs);

View file

@ -59,6 +59,8 @@ namespace Microsoft.Terminal.Control
void UpdateScrollbar(Double newValue);
Boolean ManglePathsForWsl { get; };
event Windows.Foundation.TypedEventHandler<Object, OpenHyperlinkEventArgs> OpenHyperlink;
event Windows.Foundation.TypedEventHandler<Object, ScrollPositionChangedArgs> ScrollPositionChanged;
event Windows.Foundation.TypedEventHandler<Object, PasteFromClipboardEventArgs> PasteFromClipboard;

View file

@ -2298,7 +2298,16 @@ namespace winrt::Microsoft::Terminal::Control::implementation
std::wstring fullPath{ item.Path() };
// Fix path for WSL
if (_settings.ProfileSource() == L"Windows.Terminal.Wsl")
// In the fullness of time, we should likely plumb this up
// to the TerminalApp layer, and have it make the decision
// if this control should have it's path mangled (and do the
// mangling), rather than exposing the source concept to the
// Control layer.
//
// However, it's likely that the control layer may need to
// know about the source anyways in the future, to support
// GH#3158
if (_interactivity.ManglePathsForWsl())
{
std::replace(fullPath.begin(), fullPath.end(), L'\\', L'/');

View file

@ -48,6 +48,7 @@
// All of these settings are defined in IControlSettings.
#define CONTROL_SETTINGS(X) \
X(winrt::hstring, ProfileName) \
X(winrt::hstring, ProfileSource) \
X(bool, UseAcrylic, false) \
X(winrt::hstring, Padding, DEFAULT_PADDING) \
X(winrt::hstring, FontFace, L"Consolas") \