Skip to content

Configurable line ending convention for file writes #1139

@cek

Description

@cek

Is your feature request related to a problem? Please describe.
On Windows, file-writing tools (replace_content, create_text_file, replace_symbol_body, etc.) produce CRLF line endings because CodeEditor._save_edited_file() opens files in text mode using the platform-default line ending. Projects that use LF line endings on Windows end up with mixed line endings after edits.

Describe the solution you'd like
A line_ending option in project.yml (with possible values: "lf", "crlf", "native"; default "native" for backwards compatibility, or similar).

Describe alternatives you've considered
Git-based workarounds: core.autocrlf=true or .gitattributes with * text=auto. These work but create friction (staging noise, hook conflicts, inconsistent behavior across tools).

Additional context
I believe the changes required would be quite small in scope:

  • CodeEditor._save_edited_file() (code_editor.py:76): pass newline= to open()
  • CreateTextFileTool.apply() (tools/file_tools.py:76): pass newline= to Path.write_text()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions