@@ -133,20 +133,22 @@ def run(
133133 # Check terminal size
134134 new_height = term .height or 24
135135 new_width = term .width or 80
136- maybe_clear_prefix , maybe_clear_suffix = b"" , b""
136+ maybe_clear_seq = b""
137137 if (new_height , new_width ) != (height , width ):
138- # Write video frame with clear sequence inside synchronized output mode (DEC
139- # 2026) to prevent flicker, and, set last_frame as inverse of the current frame
140- # to ensure a full redraw by the blitter
141- maybe_clear_prefix = b"\033 [?2026h\033 [H\033 [2J"
142- maybe_clear_suffix = b"\033 [?2026l"
138+ maybe_clear_seq = b"\033 [H\033 [2J"
143139 height , width = new_height , new_width
144140 refx , refy = get_ref (width , height , console )
145141 last_frame = ~ video
146- # Render frame
147- video_data = maybe_clear_prefix + blit (
148- video , last_frame , refx , refy , width - 1 , height , color_mode
149- ) + maybe_clear_suffix
142+ # Render frame with synchronized output mode (DEC 2026) to prevent flickering
143+ # when the screen is cleared, or an artificial CRT-like "rolling band" side-effects
144+ # from fast "sprite blinking" meant to cause "transparency" effect on original HW,
145+ # https://zladx.github.io/posts/links-awakening-partial-translucency
146+ video_data = (
147+ b"\033 [?2026h"
148+ + maybe_clear_seq
149+ + blit (video , last_frame , refx , refy , width - 1 , height , color_mode )
150+ + b"\033 [?2026l"
151+ )
150152 last_frame = video .copy ()
151153 # Update reporting
152154 data_length .append (len (video_data ))
0 commit comments