Skip to content

Commit

Permalink
Fix: Fixed an issue with launching programs from the Address Bar (#15459
Browse files Browse the repository at this point in the history
)
  • Loading branch information
FieryRMS authored May 24, 2024
1 parent b52bb1b commit ee185c6
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -815,17 +815,10 @@ private void SavePathToHistory(string path)

private static async Task<bool> LaunchApplicationFromPath(string currentInput, string workingDir)
{
var trimmedInput = currentInput.Trim();
var fileName = trimmedInput;
var arguments = string.Empty;
if (trimmedInput.Contains(' '))
{
var positionOfBlank = trimmedInput.IndexOf(' ');
fileName = trimmedInput.Substring(0, positionOfBlank);
arguments = currentInput.Substring(currentInput.IndexOf(' '));
}

return await LaunchHelper.LaunchAppAsync(fileName, arguments, workingDir);
var args = CommandLineParser.SplitArguments(currentInput);
return await LaunchHelper.LaunchAppAsync(
args.FirstOrDefault("").Trim('"'), string.Join(' ', args.Skip(1)), workingDir
);
}

public async Task SetAddressBarSuggestionsAsync(AutoSuggestBox sender, IShellPage shellpage)
Expand Down

0 comments on commit ee185c6

Please sign in to comment.