commit 53887b375c6581bf51b48967a161b9b3b62cb221
parent 52f25e5495bbd967ac3dac1bbe9c2543400faf8e
Author: Martin Strobel <marstr@microsoft.com>
Date: Thu, 18 Feb 2021 15:30:54 -0800
Add Hyperlink function to VirtualTerminal TextFormat namespace (#758)
Diffstat:
3 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt
@@ -146,6 +146,7 @@ hstring
html
http
https
+Hyperlink
IApplication
IAppx
IAsync
diff --git a/src/AppInstallerCLICore/VTSupport.cpp b/src/AppInstallerCLICore/VTSupport.cpp
@@ -149,6 +149,13 @@ namespace AppInstaller::CLI::VirtualTerminal
{
}
+
+ ConstructedSequence Hyperlink(const std::string& text, const std::string& ref)
+ {
+ std::ostringstream result;
+ result << AICLI_VT_OSC "8;;" << ref << AICLI_VT_ESCAPE << "\\" << text << AICLI_VT_OSC << "8;;" << AICLI_VT_ESCAPE << "\\";
+ return ConstructedSequence{ result.str() };
+ }
}
namespace TextModification
diff --git a/src/AppInstallerCLICore/VTSupport.h b/src/AppInstallerCLICore/VTSupport.h
@@ -123,6 +123,8 @@ namespace AppInstaller::CLI::VirtualTerminal
{
}
+
+ ConstructedSequence Hyperlink(const std::string& text, const std::string& ref);
}
namespace TextModification