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