# Katalon automatically changes line endings between \\r\\n and \\n constantly

**URL:** <https://forum.katalon.com/t/katalon-automatically-changes-line-endings-between-r-n-and-n-constantly/69325>\
**Category:** Bug Report\
**Tags:** feature-request, bugs-report, katalon-studio\
**Created:** [September 6, 2022, 8:16pm UTC](https://forum.katalon.com/t/katalon-automatically-changes-line-endings-between-r-n-and-n-constantly/69325 "2022-09-06T20:16:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbrod](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/sbrod/32/20464_2.png) [@sbrod](https://forum.katalon.com/u/sbrod)\
**Post date:** [September 6, 2022, 8:16pm UTC](https://forum.katalon.com/t/katalon-automatically-changes-line-endings-between-r-n-and-n-constantly/69325/1 "2022-09-06T20:16:00Z")

</div>

### Operating System

Windows 10

### Katalon Studio version

8.4.1

### Steps to reproduce

1. Open/rename/move a file
2. Check version tracking and see that it modified line endings seemingly randomly and arbitrarily (doesn’t happen with every file)

**Expected Behavior**  
Katalon does not automatically change line-endings or allows a default line ending to be specified in the settings.

**Actual Behavior**  
When opening, renaming, and moving files, Katalon will sometimes automatically make changes to line endings, changing \r\n to \n or vice versa. This is a problem for everyone on our team and happens nowhere else in the project–only Katalon. It happens in 1 of 2 ways:

The first is that a few lines get targeted, usually in the spaces at the beginning/end/between methods.

The second is that the entire file gets targeted, with every line showing a line ending change.

**Screenshots / Videos** (please attach screenshots or videos if necessary to reproduce the issue)  
Example of specific lines being changed

 ![Example of specific lines being changed](https://europe1.discourse-cdn.com/katalon/original/3X/f/3/f3e3577af65511b663ef00d58aefd8040fa46964.png)  
Example of entire file being changed (code excluded)  
 ![Example of entire file being changed (code excluded)](https://europe1.discourse-cdn.com/katalon/original/3X/1/8/18c062873b62b0a2b0bea4e01ecaae90b77eabf4.png)

---

<div class="post-metadata">

**Author:** ![chen.lee](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@chen.lee](https://forum.katalon.com/u/chen.lee)\
**Post date:** [September 6, 2022, 11:50pm UTC](https://forum.katalon.com/t/katalon-automatically-changes-line-endings-between-r-n-and-n-constantly/69325/2 "2022-09-06T23:50:25Z")

</div>

I will report this to the Product Team to investigate the bug.

---

<div class="post-metadata">

**Author:** ![sbrod](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/sbrod/32/20464_2.png) [@sbrod](https://forum.katalon.com/u/sbrod)\
**Post date:** [September 7, 2022, 12:38am UTC](https://forum.katalon.com/t/katalon-automatically-changes-line-endings-between-r-n-and-n-constantly/69325/3 "2022-09-07T00:38:00Z")

</div>

I did some more investigating and found that these 2 examples actually seem to be separate issues. The 1st example happens on lines that are otherwise empty besides whitespace. Katalon Studio seems to automatically remove the excess whitespace (would still be nice to toggle this off though). The 2nd example is the main issue described, however.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [September 7, 2022, 2:31am UTC](https://forum.katalon.com/t/katalon-automatically-changes-line-endings-between-r-n-and-n-constantly/69325/4 "2022-09-07T02:31:05Z")

</div>

Git handles line endings, as documented:

> **[Configuring Git to handle line endings - GitHub Docs](https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings)**
>
> To avoid problems in your diffs, you can configure Git to properly handle line endings.

If 2 or more members are working in a Git repository with different git config, a man A may have his git configured to convert CR+LF-\>LF when he makes a commit, another man B may have his git configured to convert LF-\>CR+LF when he makes a commint. In this case you may see the line ending of a file is changed by A and B; it may look irregular to you.

Your team should discuss and agree with a single Git config of the project for line ending.

I believe that Katalon does nothing about line endings.

---

<div class="post-metadata">

**Author:** ![sbrod](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/sbrod/32/20464_2.png) [@sbrod](https://forum.katalon.com/u/sbrod)\
**Post date:** [September 7, 2022, 7:50pm UTC](https://forum.katalon.com/t/katalon-automatically-changes-line-endings-between-r-n-and-n-constantly/69325/5 "2022-09-07T19:50:46Z")

</div>

I thought of that, but that’s why I specified that it doesn’t happen anywhere else in the project, only in Katalon. If it was a git issue, you would expect that the same thing happens in other editors, no?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [September 7, 2022, 10:22pm UTC](https://forum.katalon.com/t/katalon-automatically-changes-line-endings-between-r-n-and-n-constantly/69325/6 "2022-09-07T22:22:40Z")

</div>

Katalon Studio has a setting of line ending in the Preference menu.

 ![スクリーンショット 2022-09-08 7.19.27](https://europe1.discourse-cdn.com/katalon/original/3X/a/d/ad24bf5556b89f8035e801f9995b37f5ef13e26f.jpeg)

How is it set on the machines of your team?

---

<div class="post-metadata">

**Author:** ![sbrod](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/sbrod/32/20464_2.png) [@sbrod](https://forum.katalon.com/u/sbrod)\
**Post date:** [September 7, 2022, 10:32pm UTC](https://forum.katalon.com/t/katalon-automatically-changes-line-endings-between-r-n-and-n-constantly/69325/7 "2022-09-07T22:32:45Z")

</div>

I’d assume default for everyone. To my knowledge, we’re all on windows, but I’ll check. I’m wondering if someone previously on the project from a long time ago used something besides windows, which would make only a handful of files use a different line ending. Then when we move or rename these files the line endings get changed to our default (windows). I’ll have to investigate.

Thank you; this is very helpful.

Edit: Okay yeah, so everyone is currently on windows and has always been on windows. So that theory is bust.

---

<div class="post-metadata">

**Author:** ![mateusz.mysliwiec](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mateusz.mysliwiec/32/23869_2.png) [@mateusz.mysliwiec](https://forum.katalon.com/u/mateusz.mysliwiec)\
**Post date:** [November 22, 2024, 2:18pm UTC](https://forum.katalon.com/t/katalon-automatically-changes-line-endings-between-r-n-and-n-constantly/69325/8 "2024-11-22T14:18:47Z")

</div>

Anyone ever resolved that issue?

---

<div class="post-metadata">

**Author:** ![depapp](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/depapp/32/29178_2.png) [@depapp](https://forum.katalon.com/u/depapp)\
**Post date:** [October 9, 2026, 8:58am UTC](https://forum.katalon.com/t/katalon-automatically-changes-line-endings-between-r-n-and-n-constantly/69325/9 "2026-10-09T08:58:38Z")

</div>

hi @mateusz.mysliwiec

it is not random, it is two things stacked. katalon (eclipse underneath) writes new or rewritten files with the delimiter from Preferences \> General \> Workspace \> “New text file line delimiter”, default is “platform”, so a mac or linux teammate (or a linux ci box that commits) produces \n and windows produces \r\n. and when katalon rewrites a .tc or .rs file it can rewrite the whole file, so the diff shows every line.

fix it at the git level so it stops mattering what each machine does:

```auto
# .gitattributes at the project root
* text=auto
*.groovy text eol=lf
*.tc text eol=lf
*.ts text eol=lf
*.rs text eol=lf
*.glbl text eol=lf
*.prj text eol=lf

```

then once, from the project root: git add --renormalize . and commit. after that git stores lf and checks out whatever the attribute says, so katalon can write what it wants and the diff stays clean. pick crlf instead of lf if the whole team is on windows, just pick one.
