Incorrect Display of Pipe Character in read_file Tool

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When reading a file with the read_file tool, the pipe character (|) is incorrectly displayed as || (double pipe).

Test File Example

Create a file with the following content:

|

Steps to Reproduce

  1. Create a file containing only a pipe character (|) (e.g., file content is just |)
  2. Read the file using the read_file tool
  3. Check the display result

Expected Behavior

The pipe character (|) in the file should be displayed as | (single pipe).

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

バージョン: 2.0.69 (Universal)
コミット: 1.99.3
日付: 63fcac100bd5d5749f2a98aa47d65f6eca61db30
Electron: 2025-11-07T18:21:29.650Z
ElectronBuildId: 37.7.0
Chromium: undefined
Node.js: 138.0.7204.251
V8: 22.20.0
OS: 13.8.258.32-electron.0

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

hi @kyos1704 and thank you for the detailed bug report.

Does the issue also cause Agent to read || instead of | and then use || in code output or is it primarily a display issue?

When instructed to read and edit code or documentation using a read_file tool, the AI interprets the single pipe character (|) as a double pipe (||).

The AI then attempts to “fix” the perceived error by changing the double pipe (||) back to a single pipe (|).

However, since the single pipe (|) is already the correct character, the documentation is not truly modified, yet the AI continues to read it as the incorrect double pipe (||) in the subsequent step.

This repeated misinterpretation and attempted correction results in the AI entering an infinite loop.

This issue has corrupted the context several times.

It appears to be potentially reproducible in my environment when requesting a code modification where the pipe symbol (|) is correctly used in the code.

Regarding step 2 of “Steps to Reproduce,” which is “Read the file using the read_file tool,” I should have specified the premise “when the AI is instructed to perform this action.”

Forwarded the details to the team.

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.