diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Commands/MainListPage.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Commands/MainListPage.cs index 2489cd0817..2ee8f1e357 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Commands/MainListPage.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Commands/MainListPage.cs @@ -547,6 +547,15 @@ public partial class MainListPage : DynamicListPage, // above "git" from "whatever" max = max + extensionTitleMatch; + // Apply a penalty to fallback items so they rank below direct matches. + // Fallbacks that dynamically match queries (like RDP connections) should + // appear after apps and direct command matches. + if (isFallback && max > 1) + { + // Reduce fallback scores by 50% to prioritize direct matches + max = max * 0.5; + } + var matchSomething = max + (isAliasMatch ? 9001 : (isAliasSubstringMatch ? 1 : 0));