Skip to content

System.IO.IOException on MacOS pwsh #5225

Open

Description

@robertweiganddmhr

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

Activity

  1. michael-yi-wang commented on Oct 26, 2026

    @michael-yi-wang

    I am having the same issue.

    ### Environment
    PSReadLine: 2.4.5
    PowerShell: 7.6.9
    OS: macOS 27.0.1
    BufferWidth: 240
    BufferHeight: 60
    
    Last 0 Keys:
    
    
    
    ### Exception
    
    System.IO.IOException: The system cannot open the device or file specified. : 'PSReadLineHistoryFile_2106025907'. 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)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions