Skip to content

fix: improve Windows compatibility for CLI commands and sandbox - #261

Merged
tibo-openai merged 2 commits into
openai:mainfrom
khossdev:fix/windows-compatibility
Apr 17, 2025
Merged

tibo-openai merged 2 commits into
openai:mainfrom
khossdev:fix/windows-compatibility

Conversation

@khossdev

Copy link
Copy Markdown
Contributor

Fix Windows compatibility issues (#248)

This PR addresses the Windows compatibility issues reported in #248:

  1. Fix sandbox initialization failure on Windows

    • Modified getSandbox() to return SandboxType.NONE on Windows instead of throwing an error
    • Added a warning log message to inform the user that sandbox is not available on Windows
  2. Fix Unix commands not working on Windows

    • Created a new module platform-commands.ts that automatically adapts Unix commands to their Windows equivalents
    • Implemented a mapping table for common commands and their options
    • Integrated this functionality into the command execution process

Testing

Tested on Windows 10 with the following commands:

  • ls -R . (now automatically translates to dir /s .)
  • Other Unix commands like grep, cat, etc.

The CLI no longer crashes when running these commands on Windows.

I have read the CLA Document and I hereby sign the CLA

Signed-off-by: Alpha Diop <alphakhoss@gmail.com>
Signed-off-by: Alpha Diop <alphakhoss@gmail.com>
@tibo-openai

Copy link
Copy Markdown
Collaborator

Looks great, ty!

@tibo-openai
tibo-openai merged commit 3a71175 into openai:main Apr 17, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 17, 2025
@khossdev
khossdev deleted the fix/windows-compatibility branch April 19, 2025 14:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants