Skip to content

The issue of being unable to create files in Windows (CR LF) format #18616

@cyf007-lab

Description

@cyf007-lab

Description

I use OpenCode under the Windows system. It's an excellent AI programming tool, and I really like it.
However, I am currently troubled by a problem and unsure if it can be resolved:
Using batch processing to call programs is a commonly used method in CMD/PowerShell. However, the batch files created by OpenCode are always in Unix (LF) format, whereas in the CMD/PowerShell environment, they must be in Windows (CR LF) format. Otherwise, the operation will definitely fail, especially when outputting non-English information.
This is a minor issue, but when AI encounters such problems, it often fails to solve them and can only try repeatedly, sometimes even altering the correct batch file beyond recognition.
Don't recommend me to use the WSL environment. I don't want to change my working environment.

Plugins

No plugins were used

OpenCode version

1.2.27

Steps to reproduce

  1. Open OpenCode
  2. Input prompt: Create a batch file and output the current operating system and shell environment, requiring Chinese output
  3. AI will create batch files and then try them out. Due to the Unix (LF) format, errors are inevitable during the run
  4. Then the AI will get stuck in repeated attempts at modification

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal + Git Bash

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)windows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions