Skip to content

fix(fs_write): preserve CRLF line endings - #3910

Open
voidstackloop wants to merge 1 commit into
aws:mainfrom
voidstackloop:fix/crlf-detection-wsl-1751
Open

voidstackloop wants to merge 1 commit into
aws:mainfrom
voidstackloop:fix/crlf-detection-wsl-1751

Conversation

@voidstackloop

Copy link
Copy Markdown

Fixes #1751.

Summary

  • detect the existing file's line ending before str_replace
  • translate only the requested old and new strings, preserving unrelated file content
  • cover both the agent and chat CLI implementations with CRLF regression tests

Tests

  • cargo test -p agent agent::tools::fs_write::tests (10 passed)
  • cargo test -p chat_cli cli::chat::tools::fs_write::tests (14 passed)
  • cargo clippy --locked -p agent -p chat_cli -- -D warnings
  • nightly rustfmt --check on both modified files

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support CRLF detection in WSL

1 participant