-
Notifications
You must be signed in to change notification settings - Fork 512
PSReadLine Command History is not saving to the HistorySavePath location #2086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks @stevenjudd for opening this issue, you have some very valid concerns.
It looks like you are using the PowerShell extension, rather than the PowerShell Preview extension which unfortunately is the only place where PSReadline support is available in VSCode, we are tracking this issue with #1793
This is a result of PSReadLine using the host name to create this file path--changing our host name would be a substantial breaking change so we are unlikely to update this, although we agree it would be nicer to not have white spaces. |
FYI our host name is defined here. It imitates the ISE's host name, which is |
As a work around, you can put this in your profile (still requires the preview version of the extension): if ($psEditor -and (Get-Module PSReadLine)) {
$currentSavePath = (Get-PSReadLineOption).HistorySavePath
Set-PSReadLineOption -HistorySavePath $currentSavePath.Replace($Host.Name, 'ConsoleHost')
} |
This issue is being closed as inactive, if this issue is still occurring it will be re-opened |
System Details
System Details Output
Issue Description
I am experiencing a problem with the PSReadline HistorySavePath file. First, it is not saving the command history to the defined file location.
Second, it would be preferred to have the default file name to not have white space characters in the name. Thus "Visual Studio Code Host_history.txt" would be "VisualStudioCodeHost_history.txt"
Third, the Set-PSReadlineOption -HistorySavePath command does not seem to save the path for the history file.
Expected Behaviour
The file specified in the HistorySavePath should be created and should contain the commands entered into the Integrated Console.
Actual Behaviour
The file is not created and the command history is not stored in this file.
Attached Logs
vscode-powershell.log
EditorServices.log
Start-EditorServices-EditorServices.log
The text was updated successfully, but these errors were encountered: