Linux 在 PowerShell 中读取或写入历史文件时出错
Error reading or writing history file in PowerShell on Linux
我刚刚在 2x boxes 运行 RHEL 7.x (maipo) 上安装了 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 并安装它。而且这两个盒子实际上是彼此的副本:(
有什么建议吗?
呃 .. 刚刚弄明白了。这是一个错误的 umask 设置,覆盖了我的 ~/.bashrc 中的默认值。
将其注释掉即可解决问题。
我刚刚在 2x boxes 运行 RHEL 7.x (maipo) 上安装了 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 并安装它。而且这两个盒子实际上是彼此的副本:(
有什么建议吗?
呃 .. 刚刚弄明白了。这是一个错误的 umask 设置,覆盖了我的 ~/.bashrc 中的默认值。
将其注释掉即可解决问题。