在 Linux 上的 PowerShell 中读取或写入历史记录文件时出错



我刚刚在运行RHEL 7.x(maipo(的2x机器上安装了PS 7.0.2。奇怪的是,其中一个显示以下错误

$ pwsh
PS /home/user_name> dir
Error reading or writing history file '/home/user_name/.local/share/powershell/PSReadLine/Console_history.txt': Access to the path '/home/user_name/.local/share/powershell/PSReadLine/Console_history.txt' is denied
PS /home/user_name> exit
Error reading or writing history file '/home/user_name/.local/share/powershell/PSReadLine/Console_history.txt': Access to the path '/home/user_name/.local/share/powershell/PSReadLine/Console_history.txt' is denied
This error will not be reported again in this session. Consider using a different path with:
Set-PSReadLineOption -HistorySavePath <Path>
Or not saving history with:
Set-PSReadLineOption -HistorySaveStyle SaveNothing

我不知道为什么。我所做的只是下载 RPM 并安装它。这两个盒子实际上是彼此的副本:(

有什么建议吗?

Err .. 刚刚想通了。这是一个错误的掩码设置,覆盖了我的 ~/.bashrc 中的默认值。

注释掉它解决了问题。

最新更新