Windows line endings get replaced with linux line endings on edits #1347

Closed
opened 2026-02-16 17:30:32 -05:00 by yindo · 4 comments
Owner

Originally created by @cvzakharchenko on GitHub (Aug 17, 2025).

Originally assigned to: @thdxr on GitHub.

This would not even be a big deal, but it screws up the diff views, since the diff shows changes in every line. Sorry, share doesn't work, so here is a screenshot. Notice that 2 lines have changed, but the diff shows a change in 4 lines because of line endings.

Image
Originally created by @cvzakharchenko on GitHub (Aug 17, 2025). Originally assigned to: @thdxr on GitHub. This would not even be a big deal, but it screws up the diff views, since the diff shows changes in every line. Sorry, share doesn't work, so here is a screenshot. Notice that 2 lines have changed, but the diff shows a change in 4 lines because of line endings. <img width="979" height="584" alt="Image" src="https://github.com/user-attachments/assets/e1448771-7c0d-40b1-8a49-8877e912c7fe" />
yindo added the windows label 2026-02-16 17:30:32 -05:00
yindo closed this issue 2026-02-16 17:30:32 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 17, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1676: Similar line ending handling issues in multi-line replacements - this bug involved incorrect handling of line breaks during edits
  • #631: General Windows Support tracking issue - covers various Windows-specific compatibility problems
  • #603, #379: Character encoding issues in diff views (closed) - related to diff display problems with special characters

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Aug 17, 2025): This issue might be a duplicate of existing issues. Please check: - #1676: Similar line ending handling issues in multi-line replacements - this bug involved incorrect handling of line breaks during edits - #631: General Windows Support tracking issue - covers various Windows-specific compatibility problems - #603, #379: Character encoding issues in diff views (closed) - related to diff display problems with special characters Feel free to ignore if none of these address your specific case.
Author
Owner

@cvzakharchenko commented on GitHub (Aug 22, 2025):

I've been using the fix in https://github.com/sst/opencode/pull/2017 for the last couple of days, and it works perfectly.

@cvzakharchenko commented on GitHub (Aug 22, 2025): I've been using the fix in https://github.com/sst/opencode/pull/2017 for the last couple of days, and it works perfectly.
Author
Owner

@Hona commented on GitHub (Nov 16, 2025):

@rekram1-node I think #4356 would fix this by just ignoring line endings in diff snapshots

@Hona commented on GitHub (Nov 16, 2025): @rekram1-node I think #4356 would fix this by just ignoring line endings in diff snapshots
Author
Owner

@rekram1-node commented on GitHub (Nov 17, 2025):

merged

@rekram1-node commented on GitHub (Nov 17, 2025): merged
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1347