mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Allow Run to handle commandlines with spaces (#42016)
This better handles cases where commandlines might have embedded spaces. For something like ``` C:\Program Files\PowerShell\7\pwsh.exe -c write-host dawg ``` we'll now see that `C:\Program` isn't a file, and we'll try to look at `C:\Program Files\PowerShell\7\pwsh.exe` instead. This code is pilfered from https://github.com/microsoft/terminal/pull/12348 which fixed https://github.com/microsoft/terminal/issues/12345. Terminal has great code for normalizing a string into an executable and args, so why not just use it here. related to #41646 related to #41705 (but much more narrowly scoped) ---- I added some tests too. drive-by fix: as I was adding tests, I added a helper for "make a change to a page, and await the page's ItemsChanged". This removes a bunch of `await 1s` calls, and brings the shell page tests from like, 7s to 500ms
This commit is contained in:
@@ -92,7 +92,7 @@ internal sealed partial class FallbackExecuteItem : FallbackCommandItem, IDispos
|
||||
return;
|
||||
}
|
||||
|
||||
ShellHelpers.ParseExecutableAndArgs(searchText, out var exe, out var args);
|
||||
ShellListPageHelpers.NormalizeCommandLineAndArgs(searchText, out var exe, out var args);
|
||||
|
||||
// Check for cancellation before file system operations
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
Reference in New Issue
Block a user