Skip to content

Commit f648ac4

Browse files
authored
Save raw command instead of resolved command in shell history (microsoft#10000)
1 parent 8f3e051 commit f648ac4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • src/modules/launcher/Plugins/Microsoft.Plugin.Shell

src/modules/launcher/Plugins/Microsoft.Plugin.Shell/Main.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ private List<Result> ResultsFromlHistory()
156156

157157
private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdministrator = false)
158158
{
159-
command = command.Trim();
160-
command = Environment.ExpandEnvironmentVariables(command);
159+
string trimmedCommand = command.Trim();
160+
command = Environment.ExpandEnvironmentVariables(trimmedCommand);
161161
var workingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
162162
var runAsAdministratorArg = !runAsAdministrator && !_settings.RunAsAdministrator ? string.Empty : "runas";
163163

@@ -218,7 +218,7 @@ private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdmin
218218

219219
info.UseShellExecute = true;
220220

221-
_settings.AddCmdHistory(command);
221+
_settings.AddCmdHistory(trimmedCommand);
222222

223223
return info;
224224
}

0 commit comments

Comments
 (0)