Terminal flickers on rapid print #19513

Closed
opened 2026-01-31 06:45:33 +00:00 by claunia · 3 comments
Owner

Originally created by @janausis on GitHub (Mar 9, 2023).

Windows Terminal version

1.16.10262.0

Windows build number

10.0.22621.1344

Other Software

Python 3.10

Steps to reproduce

Run this script in windows terminal:

i = 0
from time import sleep
print("\n\n\n")

while True:
    sleep(0.1)
    print("progress made progress made progress made\n\n\n" + str(i) + '\033[1A\033[2K\033[1A\033[2K\033[1A')
    i += 1
    if i > 100:
        i = 0

Expected Behavior

No flickering like on linux terminals.

Behavior:
Text

Progress Bar

Actual Behavior

The print command gets rendered by character so old states before new line cause a flickering effect.

Behavior:
Text
flickering Text
Progress Bar

Originally created by @janausis on GitHub (Mar 9, 2023). ### Windows Terminal version 1.16.10262.0 ### Windows build number 10.0.22621.1344 ### Other Software Python 3.10 ### Steps to reproduce Run this script in windows terminal: ``` i = 0 from time import sleep print("\n\n\n") while True: sleep(0.1) print("progress made progress made progress made\n\n\n" + str(i) + '\033[1A\033[2K\033[1A\033[2K\033[1A') i += 1 if i > 100: i = 0 ``` ### Expected Behavior No flickering like on linux terminals. Behavior: **Text** **Progress Bar** ### Actual Behavior The print command gets rendered by character so old states before new line cause a flickering effect. Behavior: **Text** _flickering Text_ **Progress Bar**
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 06:45:33 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Mar 9, 2023):

Is this about what you're seeing:

gh-14972 py

(foreground: gnome-terminal, background Windows Terminal)

Kinda just looks like the Windows Terminal happens to render in the middle of the string, while that doesn't happen on gnome-terminal.

I bet this is due to conpty flushing the frame when there's a newline at the bottom of the screen. Yea it's definitely that, cause conhost doesn't flicker like that.

I think there's a dupe for this on the backlog somewhere. I know getting rid of that flush on newline is something we've talked about doing for a while now.

@zadjii-msft commented on GitHub (Mar 9, 2023): Is this about what you're seeing: ![gh-14972 py](https://user-images.githubusercontent.com/18356694/224021837-577ec2cc-d964-4cc2-a6fe-914f7ca3c18c.gif) (foreground: `gnome-terminal`, background Windows Terminal) Kinda just looks like the Windows Terminal happens to render in the middle of the string, while that doesn't happen on gnome-terminal. I bet this is due to conpty flushing the frame when there's a newline at the bottom of the screen. Yea it's definitely that, cause conhost doesn't flicker like that. I think there's a dupe for this on the backlog somewhere. I know getting rid of that flush on newline is something we've talked about doing for a while now.
Author
Owner

@zadjii-msft commented on GitHub (Mar 9, 2023):

Found it!

/dup #12336

Thanks again!

@zadjii-msft commented on GitHub (Mar 9, 2023): Found it! /dup #12336 Thanks again!
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Mar 9, 2023):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Mar 9, 2023): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19513