From 140d452ba2bfa0979f62c12b554157c4e4e1ee8a Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Mon, 6 Jun 2016 13:37:03 -0700 Subject: [PATCH] Fix PSReadLine history path on Windows Bug introduced in initial port of PSReadLine. `Path.Combine` sees the initial backslash as an absolute path, thus discarding `AppData`. --- src/Microsoft.PowerShell.PSReadLine/Cmdlets.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.PowerShell.PSReadLine/Cmdlets.cs b/src/Microsoft.PowerShell.PSReadLine/Cmdlets.cs index 7a72cee73d..ffb40e744b 100644 --- a/src/Microsoft.PowerShell.PSReadLine/Cmdlets.cs +++ b/src/Microsoft.PowerShell.PSReadLine/Cmdlets.cs @@ -172,8 +172,8 @@ namespace Microsoft.PowerShell #if CORECLR if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) // MS Windows { - HistorySavePath = System.IO.Path.Combine(Environment.ExpandEnvironmentVariables("%AppData%"), - @"\Microsoft\Windows\PowerShell\PSReadline\", + HistorySavePath = System.IO.Path.Combine(Environment.GetEnvironmentVariable("APPDATA"), + @"Microsoft\Windows\PowerShell\PSReadline\", hostName + "_history.txt"); }