Updating Envronment Script fails on windows

Where does the bug appear (feature/product)?

Background Agent (GitHub, Slack, Web, Linear)

Describe the Bug

Editing “Update Script” in browser on windows will cause error regarding to new line. The system says like Unexpected token “\r” found.

Steps to Reproduce

On WIndows, Enter echo “Foo” (newline) echo “Bar”.

Expected Behavior

CRLF is converted to LF.

Operating System

Windows 10/11

Version Information

Cursor website

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. This is a bug on our side. When you type a script in the browser editor on Windows, it inserts CRLF \r\n, and the \r ends up in the command that runs via bash. That’s why you see Unexpected token "\r". We don’t currently normalize CRLF to LF on this path. I’ve filed an internal report.

Workarounds for now:

  • Put the commands on one line using &&, with no line breaks: echo "Foo" && echo "Bar"
  • Or write the script in an editor that uses LF line endings, then paste the final text in, avoiding line breaks typed directly in the browser.

If none of that works, let me know and we’ll dig in more.

I hope to see cursor normalizes CRLF after edit.