Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

System.IO.IOException on MacOS pwsh

Aberta
#5,225 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
55/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
csharp, macos, powershell
Domínio
cli

Direção de pesquisa

Start at PSConsoleReadLine.DelayedOneTimeInitialize() in the stack trace and trace how the history file name is used to create the mutex, especially when pwsh runs under sudo on macOS. Reproduce with the listed command and compare behavior with a normal shell session. Done means the exception no longer prevents PSReadLine from working in the reported setup.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Needs-Triage :mag:
Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.
Exception report
Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.yaml
Thank you!

### Environment
PSReadLine: 2.4.5
PowerShell: 7.6.8
OS: macOS 26.7.1
BufferWidth: 80
BufferHeight: 24

Last 0 Keys:



### Exception

System.IO.IOException: The system cannot open the device or file specified. : 'PSReadLineHistoryFile_3549844812'. One or more system calls failed: lstat("", ...) == -1; errno == ENOENT;
   at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, NamedWaitHandleOptionsInternal options, Boolean& createdNew)
   at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
   at Microsoft.PowerShell.PSConsoleReadLine.DelayedOneTimeInitialize()
   at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)
Screenshot
Image
Environment data
PS Version: 7.6.8
PS HostName: ConsoleHost
PSReadLine Version: 
PSReadLine EditMode: Emacs
OS: Darwin dm-XXXXX 25.6.0 Darwin Kernel Version 25.6.0: Tue Aug 18 17:49:53 PDT 2026; root:xnu-12377.161.15.700.19~2/RELEASE_ARM64_T6030 arm64
BufferWidth: 114
BufferHeight: 59
Steps to reproduce

run "sudo pwsh" in the terminal

Expected behavior

No exception

Actual behavior

Exception, PSReadLine does not work, has to be removed with "Remove-Module PSReadLine" to be able to use pwsh

Linguagem predominante
C#
Estrelas
4.4k
Forks
345
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de PowerShell/PSReadLine

Todas as issues de PowerShell/PSReadLine

Issues semelhantes

Mais issues de C#

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.