File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -182,13 +182,23 @@ public PSConsoleReadlineOptions(string hostName)
182182 else
183183 {
184184 // History is data, so it goes into .local/share/powershell folder
185- HistorySavePath = System . IO . Path . Combine (
186- Environment . GetEnvironmentVariable ( "HOME" ) ,
187- ".local" ,
188- "share" ,
189- "powershell" ,
190- "PSReadLine" ,
191- historyFileName ) ;
185+ var home = Environment . GetEnvironmentVariable ( "HOME" ) ;
186+
187+ if ( ! String . IsNullOrEmpty ( home ) )
188+ {
189+ HistorySavePath = System . IO . Path . Combine (
190+ home ,
191+ ".local" ,
192+ "share" ,
193+ "powershell" ,
194+ "PSReadLine" ,
195+ historyFileName ) ;
196+ }
197+ else
198+ {
199+ // No HOME, then don't save anything
200+ HistorySavePath = "/dev/null" ;
201+ }
192202 }
193203 }
194204
You can’t perform that action at this time.
0 commit comments