mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-07 17:42:45 +08:00
Save raw command instead of resolved command in shell history (#10000)
This commit is contained in:
parent
8f3e0517ca
commit
f648ac44b2
@ -156,8 +156,8 @@ namespace Microsoft.Plugin.Shell
|
||||
|
||||
private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdministrator = false)
|
||||
{
|
||||
command = command.Trim();
|
||||
command = Environment.ExpandEnvironmentVariables(command);
|
||||
string trimmedCommand = command.Trim();
|
||||
command = Environment.ExpandEnvironmentVariables(trimmedCommand);
|
||||
var workingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||
var runAsAdministratorArg = !runAsAdministrator && !_settings.RunAsAdministrator ? string.Empty : "runas";
|
||||
|
||||
@ -218,7 +218,7 @@ namespace Microsoft.Plugin.Shell
|
||||
|
||||
info.UseShellExecute = true;
|
||||
|
||||
_settings.AddCmdHistory(command);
|
||||
_settings.AddCmdHistory(trimmedCommand);
|
||||
|
||||
return info;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user