claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Terminal Resize Causes Unexpected UI Scroll Position Reset

Open Iydah opened this issue 7 months ago • 1 comments

Bug Description UI teleporting to the very top of the terminal when resizing terminal

Environment Info

  • Platform: linux
  • Terminal: cursor
  • Version: 1.0.35
  • Feedback ID: d15c5f7b-2982-4c90-b3a0-fc6c9f5ded20

Errors

[{"error":"Error: String not found in file. Failed to apply edit.\n    at sO (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1610:728)\n    at C1A (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1610:104)\n    at Object.renderToolUseRejectedMessage (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1620:3404)\n    at MR2 (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1923:2844)\n    at uE (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:80:19803)\n    at tT (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:82:42555)\n    at rT (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:82:38104)\n    at _$ (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:82:38032)\n    at YU (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:82:37886)\n    at oW (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:82:34976)","timestamp":"2025-06-26T19:15:44.812Z"},{"error":"Error: String not found in file. Failed to apply edit.\n    at sO (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1610:728)\n    at C1A (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1610:104)\n    at Object.renderToolUseRejectedMessage (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1620:3404)\n    at MR2 (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1923:2844)\n    at uE (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:80:19803)\n    at tT (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:82:42555)\n    at rT (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:82:38104)\n    at _$ (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:82:38032)\n    at YU (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:82:37886)\n    at oW (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:82:34976)","timestamp":"2025-06-26T19:17:53.432Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 210053 tokens > 200000 maximum\"}}\n    at Z5.generate (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1299:12578)\n    at Jq.makeStatusError (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1314:2100)\n    at Jq.makeRequest (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1314:5311)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-06-26T19:31:04.663Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 209664 tokens > 200000 maximum\"}}\n    at Z5.generate (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1299:12578)\n    at Jq.makeStatusError (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1314:2100)\n    at Jq.makeRequest (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1314:5311)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-06-26T19:34:01.808Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 211413 tokens > 200000 maximum\"}}\n    at Z5.generate (file:///root/.local/share/fnm/node-versions/v24.3.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:1299:12578)\n    at

Note: Error logs were truncated.

Iydah avatar Jun 27 '25 00:06 Iydah

It happens more often than it should specially using claude vscode extension

JobaDiniz avatar Jun 27 '25 13:06 JobaDiniz

This is a serious problem. It seems that claude is detecting a resize and re-printing it's entire history. For some reason claude thinks the terminal has resized even when it hasn't.

It's a huge problem for a few reasons:

  • Re-printing the entire history gets extremely slow and CPU-intensive for large histories.
  • Re-printing can use so much memory that it kills VSCode entirely.

Diggsey avatar Jul 11 '25 23:07 Diggsey

Anyone working on this issue?

hith3sh avatar Aug 03 '25 14:08 hith3sh

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/2642
  2. https://github.com/anthropics/claude-code/issues/4042
  3. https://github.com/anthropics/claude-code/issues/2801

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Aug 16 '25 06:08 github-actions[bot]

This issue has been automatically closed as a duplicate of #2642.

If this is incorrect, please re-open this issue or create a new one.

🤖 Generated with Claude Code

github-actions[bot] avatar Aug 21 '25 09:08 github-actions[bot]

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Aug 29 '25 14:08 github-actions[bot]