diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index b80b77299..88829ba92 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -11,6 +11,7 @@ #include #include "TerminalPage.g.cpp" +#include #include #include "AzureCloudShellGenerator.h" // For AzureConnectionType @@ -1468,6 +1469,16 @@ namespace winrt::TerminalApp::implementation { text = co_await data.GetTextAsync(); } + // Windows Explorer's "Copy address" menu item stores a StorageItem in the clipboard, and no text. + else if (data.Contains(StandardDataFormats::StorageItems())) + { + Windows::Foundation::Collections::IVectorView items = co_await data.GetStorageItemsAsync(); + if (items.Size() > 0) + { + Windows::Storage::IStorageItem item = items.GetAt(0); + text = item.Path(); + } + } eventArgs.HandleClipboardData(text); } CATCH_LOG();