[BUG] TERM setting affects Write tool line endings when running in Kitty
Resolved 💬 3 comments Opened Mar 13, 2026 by Blackclaws Closed Apr 10, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When the TERM environment variable is set to xterm-kitty, while also running in kitty, the Write tool produces CRLF line endings on linux which break a lot of things.
Setting the TERM to xterm-256color fixes the output for the Write tool while running in kitty.
What Should Happen?
Write tool produces standard line endings not CRLF.
Error Messages/Logs
Steps to Reproduce
- Launch claude code from kitty (in my case using ml4w dotfiles) on linux
- Write a file and read back the line endings, claude can do this for you
- See that it contains CRLF
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.74
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗