Skip to content

Tool apply_patch messes up line endings in windows #37090

Description

@Stefan-Bachmann

Description

Editing files with Opencode messes up line endings in files in Windows.

Per default line endings in Windows are CRLF. However, opencode introduces LF line endings when using the builtin tool apply_patch. As I'am this problem occurs also for tool write.

Afaik a suitable merge request: #20217
This issue is related to #6348 which has been closed automatically. However, it is still a annoying issue.

Besides that I want to thank you for the amazing project!

Plugins

No response

OpenCode version

1.17.20

Steps to reproduce

  1. Use an existing code file with CRLF line endings.
  2. I use GPT 5.4 as model
  3. Use a suitable prompt such that a code line will be added.
  4. This new line should have LF endings instead of CRLF.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions