Skip to content

fix(sterm): remove automatic \n to \r\n conversion in write_output#92

Merged
ZR233 merged 1 commit intomainfrom
fix/sterm-write-output
Apr 30, 2026
Merged

fix(sterm): remove automatic \n to \r\n conversion in write_output#92
ZR233 merged 1 commit intomainfrom
fix/sterm-write-output

Conversation

@ZR233
Copy link
Copy Markdown
Member

@ZR233 ZR233 commented Apr 30, 2026

Summary

  • 移除 write_output 中将 \n 自动转换为 \r\n 的逻辑
  • 修复已有 \r\n 序列被错误转换为 \r\r\n 的问题
  • 新增测试验证 \r\n 序列被正确保留

Test plan

  • write_output_flushes_after_newlines 测试验证纯 \n 行为不变
  • write_output_preserves_existing_carriage_returns 测试验证 \r\n 被保留
  • 运行 cargo test 确认全部通过

🤖 Generated with Claude Code

The previous implementation unconditionally converted \n to \r\n by
prepending \r before each \n byte. This broke existing \r\n sequences
by turning them into \r\r\n. The fix writes bytes as-is and only
flushes after \n.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ZR233 ZR233 merged commit 71ac00b into main Apr 30, 2026
2 checks passed
@ZR233 ZR233 deleted the fix/sterm-write-output branch April 30, 2026 04:45
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.

1 participant