File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
src/cascadia/TerminalSettingsModel Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -814,10 +814,25 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
814
814
815
815
winrt::hstring SearchForTextArgs::GenerateName () const
816
816
{
817
- return winrt::hstring{
818
- fmt::format (std::wstring_view (RS_ (L" SearchForTextCommandKey" )),
819
- Windows::Foundation::Uri (QueryUrl ()).Domain ().c_str ())
820
- };
817
+ if (QueryUrl ().empty ())
818
+ {
819
+ // Return the default command name, because we'll just use the
820
+ // default search engine for this.
821
+ return RS_ (L" SearchWebCommandKey" );
822
+ }
823
+
824
+ try
825
+ {
826
+ return winrt::hstring{
827
+ fmt::format (std::wstring_view (RS_ (L" SearchForTextCommandKey" )),
828
+ Windows::Foundation::Uri (QueryUrl ()).Domain ().c_str ())
829
+ };
830
+ }
831
+ CATCH_LOG ();
832
+
833
+ // We couldn't parse a URL out of this. Return no string at all, so that
834
+ // we don't even put this into the command palette.
835
+ return L" " ;
821
836
}
822
837
823
838
winrt::hstring GlobalSummonArgs::GenerateName () const
You can’t perform that action at this time.
0 commit comments