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

Terminal Flickering

Open PierrunoYT opened this issue 6 months ago • 129 comments

https://github.com/user-attachments/assets/00d2711a-1113-433c-a542-652ad3f5ce06

PierrunoYT avatar Jun 10 '25 21:06 PierrunoYT

Thanks for the report. What terminal is that?

igorkofman avatar Jun 10 '25 21:06 igorkofman

I've been having the same issue for weeks. It's the Windows terminal (win11 for me, WSL2 Ubuntu).

I've noticed it tends to happen when the terminal history gets quite long, so I'm not sure if that's related or not? Restarting Claude doesn't fix it, I have to either open a new terminal or clear the terminal first and then re-open.

Here's what I have for settings:

HISTCONTROL=ignoreboth
HISTSIZE=10000
HISTFILESIZE=10000

nullbio avatar Jun 10 '25 23:06 nullbio

Does running /clear in claude resolve it?

igorkofman avatar Jun 10 '25 23:06 igorkofman

Use !clear periodically to clear the bash history, this would stop the flickering from happening. This would not clear the context (unlike /clear)

KokXinTan avatar Jun 11 '25 01:06 KokXinTan

It's WSL2 on Windows

PierrunoYT avatar Jun 11 '25 03:06 PierrunoYT

Its happening when the whole thread gets long.

PierrunoYT avatar Jun 11 '25 03:06 PierrunoYT

  1. In Windows - Open Windows Terminal
  2. Press Ctrl + , to open graphical settings.
  3. At the bottom left, click “Open JSON file” (or the {} icon).

Image

  1. In the opened settings.json, locate the "profiles" section and add: "compatibility.enableUnfocusedAcrylic": false

e.g. "profiles": { "defaults": { "compatibility.enableUnfocusedAcrylic": false },

  1. Save the file and close it
  2. Close all open Terminal windows completely
  3. Reopen Windows Terminal. The flickering should now be gone when using WSL or other profiles.

antonijo01 avatar Jun 12 '25 17:06 antonijo01

Same for me, made a comment in a previous issue and added a video, see https://github.com/anthropics/claude-code/issues/392#issuecomment-2970234466

Ben1980 avatar Jun 15 '25 13:06 Ben1980

It happens to me on all terminals. I'm on iTerm2 Mac mostly

jshay21 avatar Jun 18 '25 15:06 jshay21

I feel like the issue is getting worse all of a sudden, especially navigation around the prompt input field. They seem somewhat related, because they seem to happen around the same times (i.e. when I notice navigation issues, I also notice flickering issues around the same time). All seem to be tied to the size of outputs, inputs, or overall session.

nullbio avatar Jun 19 '25 07:06 nullbio

happens in ubuntu 24.04 terminal also.... this happens when the information overflows the current terminal viewport..... specially when using multiple parallel agents, this will happen... maybe on a bigger 4k monitor it doesn't but on 1080p it sure does.... just a guess

dcbra avatar Jun 21 '25 07:06 dcbra

I am also facing this same problem in mac warp terminal. solve this asap!

digitalappsbd avatar Jun 26 '25 05:06 digitalappsbd

I think we need a command to clear the chat history without it deleting the context.

nullbio avatar Jun 26 '25 05:06 nullbio

I think we need a command to clear the chat history without it deleting the context.

I think this is almost there with /compact. The command just needs a slight extension.

Ben1980 avatar Jun 27 '25 07:06 Ben1980

Same issue for me. This is making claude code almost unusable. I am using wsl2 with arch linux.

GitMurf avatar Jul 08 '25 15:07 GitMurf

Hi, maybe issue is related to term height? see https://github.com/vadimdemedes/ink/issues/359 and can you check possible fix in https://github.com/oclif/multi-stage-output/pull/11/files

xterm, flickering is annoying

osv avatar Jul 19 '25 17:07 osv

Terminal Flickering is giving me headaches, please resolves it, I can not use it after certain time.

Warning: This might give people siezure who are susceptible to it also.

https://www.epilepsy.com/what-is-epilepsy/seizure-triggers/photosensitivity

SahilDahiya avatar Jul 20 '25 21:07 SahilDahiya

I resolved this by clicking escape, and then message shows up in command field, and then i just press enter

abhishek-notes avatar Jul 31 '25 18:07 abhishek-notes

This is also occurring for me in a variety of terminals across operating systems, as @SahilDahiya mentioned, this is an issue for those who have epilepsy. While not a personal issue for me, it is something to consider

GustyCube avatar Aug 01 '25 16:08 GustyCube

I'd actually just like to add now that it affects my ability to type, as when it flickers, it seems to not register typing

GustyCube avatar Aug 06 '25 20:08 GustyCube

Yes, super bad for me, I'm gonna have a seizure or something. Anthropic, unleash Claude Code to fix it itself. Terminal window and text and the whole thing flashing up and down out of control when typing and context/history is large. On MacOS, zsh, running in Cursor/VScode native terminal.

Lets see if they have their own github action running,

@claude jump in, read all of these comments, and fix this bug/bugs, these users are very important to us and we need to get the terminal experience 100% for them asap

shane-smith-1 avatar Aug 09 '25 17:08 shane-smith-1

@GustyCube I thought claude code was closed source - how are you going to fix this yourself...?

From what I can tell, moving to incremental rendering in Ink (the cli rendering lib claude code uses) might help (assuming improve ink, and then somebody who works on CC upgrades the version of Ink that CC uses). There is a work in progress over here for those that want to dig in -> https://github.com/vadimdemedes/ink/pull/708

marbemac avatar Aug 10 '25 18:08 marbemac

@ashwin-ant Are you guys aware of this bug? My experience is that as soon as the terminal starts flickering its just a matter of time till it crashs, especially in VSCode and similar IDEs

secondsky avatar Aug 13 '25 10:08 secondsky

In case someone is looking for a workaround, for some reason enabling "Maximize throughput at the cost of higher latency" option in iTerm2 (latest beta, not sure if that matters) stopped flickering on it's tracks, as soon as I clicked the checkbox. Have not seen any flickering all day today.

dsabanin avatar Aug 14 '25 08:08 dsabanin

I see this flickering really bad when Claude Code has multiple sub-agents running at once. It's as though each sub-agent is trying to make TUI updates at once and the TUI goes crazy with flickering. Once the multiple agents have finished and I am back to a single agent (or they've all finished), the flickering completely stops.

When I continue the session with a new prompt that spawns multiple agents, the flickering comes back immediately.

jbrasted-schematic avatar Aug 14 '25 15:08 jbrasted-schematic

I have also seen this happen with a lot of subagents and a long thread. CMD+K cleared the output temporarily but then the flickering started happening again. Eventually, that lead to a memory crash related to a GC issue.

PaulRBerg avatar Sep 04 '25 18:09 PaulRBerg

Yeah, this is super bad, and happens across different terminals for me in different environments and different window sizes. I've actually switched to using new Codex VSCode extension now as this is unusable to me. Its good! Anthropic pretty please fix pretty please.

shane-smith-1 avatar Sep 04 '25 20:09 shane-smith-1

it's crazy that this has been an issue for 2 months or so and still hasn't been fixed 😂

mehicned avatar Sep 09 '25 10:09 mehicned

How to solve it on cursor (WSL2, windows)

wiatrM avatar Sep 11 '25 08:09 wiatrM

Yeah, I'm having the same issue running subagents and having an insanely flickering screen. If anyone finds a workaround, let me know!

oscarpdring avatar Sep 16 '25 02:09 oscarpdring