copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Screen flickers with cursor blink when selecting `No, and tell Copilot what to do differently` option

Open MCrank opened this issue 10 months ago • 37 comments

Describe the bug

While working with Copilot CLI in Windows Terminal from a PowerShell v7.5.4 session I experienced a screen flashing effect (Just the terminal window) with some copilot artifacts appearing on the screen with each flash. It is also filling up my terminal buffer with a complete copy of the Copilot session with each flash.

The flashing coincided with the cursor blink but was only happening when I was being asked to accept a tool use or other question and I selected the No, and tell Copilot what to do differently option because that is when the cursor appeared for me to supply input. If I used the arrow keys to move up to either Yes option, the flashing stopped.

The console input became very sluggish and non-responsive to actions such as typing or backspace to delete characters of my response input

Affected version

GitHub Copilot CLI 0.0.399.

Steps to reproduce the behavior

  1. Open Windows Terminal in a PowerShell v7.5.4 (Might be happening on other versions this is what I have installed)
  2. Change to a test directory, Open Copilot and accept the access request
  3. At the prompt type Create me a generic readme.md file for a dotnet c# rest api or anything that would cause copilot to save a file
  4. When prompted to Edit the file, use the arrow keys to move down to the 3rd option No, and tell Copilot what to do differently (Esc to stop) option and the screen should start to flicker with the cursor blink.
  5. Use the arrow keys to move up to Option 2 or Option 1 and the screen flashing stops as the cursor is not blinking for user input.

Expected behavior

When selecting the No option I expect the screen to not flash with the cursor blink and the user input to be responsive

Additional context

Terminal Emulator - Windows Terminal Version: 1.23.13503.0 Shell - PSVersion 7.5.4

Here are two videos showing the flashing issue and the terminal buffer being filled with each flash. This video doesn't really capture the flashing/flickering properly, but it gets the point across, I think. https://1drv.ms/v/c/40ecf7a473fbe994/IQCWF9xiaOV7RKKn1fUB7NU9AQsvhO6DX3OUxaA8nLWp_2s?e=XeD1U0

Here is a video showing that with each flash/flicker the terminal buffer gets filled with what is currently displayed in the terminal https://1drv.ms/v/c/40ecf7a473fbe994/IQBUbwI_6MUSSpREqUfiivFxAZdVUDwUriZdT4toHGg-2oo?e=haxUpv

MCrank avatar Jan 30 '26 08:01 MCrank

I noticed that the input prompt in plan mode doesn't seem to have this issue: the text I typed is properly recorded and rendered on the screen. The cursor is not blinking in plan mode, so it really seems like the blinking cursor is the issue.

cc @devm33: Is this something you could take a look at please? We would really appreciate. Thanks.

antoyo avatar Feb 24 '26 23:02 antoyo

I was using the CLI this morning and noticed that this no longer seems to be an issue for me.

Windows Terminal Version: 1.23.20211.0 Copilot CLI Version: 0.0.418

roehl-ottri avatar Feb 25 '26 20:02 roehl-ottri

This is still an issue for me on Linux with version 0.0.418.

antoyo avatar Feb 25 '26 20:02 antoyo

Yea this screen flashing is extremely unpleasant. I'm experiencing this in tmux + linux. The flashing doesn't occur on the session host though (macos).

tyleranton avatar Feb 25 '26 20:02 tyleranton

For now, you can get around it by typing elsewhere (VS Code or Chrome) and then pasting the text in the terminal with Ctrl-Shift-V. For copying text on the screen, simply move your cursor back to Option 1 to stop the screen flickering.

rowend36 avatar Feb 26 '26 20:02 rowend36

Yea this screen flashing is extremely unpleasant. I'm experiencing this in tmux + linux. The flashing doesn't occur on the session host though (macos).

It happens to me in macOS with tmux + wezterm. Unusable.

allpepper avatar Feb 26 '26 21:02 allpepper

I did a few tests and version 0.0.419 seems to not drop characters anymore. And I don't have flickering with "alt_screen": true. I'll confirm in a few days that it is indeed fixed for me on this version.

antoyo avatar Feb 27 '26 17:02 antoyo

I have the exact same issue. I am using VSCode via Coder remote workspaces. It's very unpleasant. Claude Code used to have this issue and they fixed it recently. Now I am back to experiencing it with Copilot CLI. Only way to fix it is Ctrl+C Ctrl+C, then restart it, /resume, and keep going. It's quite painful.

juanqui avatar Mar 02 '26 01:03 juanqui

Hey folks, just wanted to mention that we have shipped a new renderer available under the --alt-screen flag. We are workign through bugs and edge cases before making it the default.

https://github.com/github/copilot-cli/issues/239#issuecomment-3995155743

EvanBoyle avatar Mar 05 '26 15:03 EvanBoyle

Since I posted my update comment last week, I started seeing flickering issues.

The input issue seems fixed, though.

antoyo avatar Mar 05 '26 15:03 antoyo

any progress on this bug, screen is flikering like crazy, ups and downs constantly.

haimang avatar Mar 11 '26 09:03 haimang

Yes, it's crazy bad and I'm actually quite surprised this isn't remedied yet? What's the timeline on this?

johnsonav1992 avatar Mar 13 '26 13:03 johnsonav1992

To anyone still having this issue, try using the --alt-screen flag, it solved the issue for me

liraz747 avatar Mar 13 '26 16:03 liraz747

Yes, I just saw that and that flag works but I guess I'm wondering why this isn't fixed without having to use that flag?

johnsonav1992 avatar Mar 13 '26 17:03 johnsonav1992

I tried use the flag, but

  1. it significantly slows down page scrolls
  2. it is now flickering side ways when prompting with language other than English.

haimang avatar Mar 15 '26 04:03 haimang

I do not want to use --alt-screen for other reasons. Please fix this and the possibly related #1811

mbest avatar Mar 21 '26 15:03 mbest

This should be resolved in current releases. In v1.0.12, alt-screen mode became always on, which removed the rendering path that caused flickering during cursor blink. In v1.0.13, a related issue with dropped keystrokes in elicitation dialogs, including the "tell Copilot what to do differently" prompt, was also fixed. If you still see this on the latest version, please comment here with your version and repro details.

examon avatar Apr 07 '26 09:04 examon