ansi rendering fails unless a 1ms delay is inserted into echo statement #22441

Open
opened 2026-01-31 08:13:16 +00:00 by claunia · 0 comments
Owner

Originally created by @ClaireCJS on GitHub (Oct 21, 2024).

Windows Terminal version

1.20.11781.0

Windows build number

10.0.19045.5011

Other Software

No response

Steps to reproduce

I think this may be a new bug that just creep in.

BACKGROUND: I have an "askyn.bat" that asks Yes/no questions. It has a "big" option to use VT100 double-height text. Starting this week, my "big" double-height questions started getting a newline inserted in between.... But only if I was at the very lowest row of the console when calling it. It looked like this:
Image

THE FIX: After some rather extensive testing, the solution was the very last thing I'd ever expect.

It was inserting a 1ms delay prior to the newline!!!!!!!!

Image

Literally, remarking out the delay /m 1 (one millisecond delay) changes the rendering from aforementioned screenshot to correct output:
Image

I sincerely doubt this is by design.

I sincerely doubt that a 1 millisecond delay before outputting a newline should somehow change the ANSI rendering such that there is a phantom extra newline that appears out of nowhere.

And one of the reasons for my sincere doubt is —— This is a script i've been using for a year. It just broke today. Consistently.

FOR REFERENCE: "echos" is the same as echo, but without a newline at the end. "delay" is like unix's sleep, but accepts millisecond delays with the /m option. "big_top" and "big_bot" are the ansi codes for double-height text, top line and bottom line. Ansi_clear_to_end is simply to clear any screen garbage off from the right of the line. Ansi_save_position is the ansi code to save screen position, which I use to write "yes" "no" in the correct place once the user has responded to the Y/N prompt.

Expected Behavior

(See above)

Actual Behavior

(see above)

Originally created by @ClaireCJS on GitHub (Oct 21, 2024). ### Windows Terminal version 1.20.11781.0 ### Windows build number 10.0.19045.5011 ### Other Software _No response_ ### Steps to reproduce I think this may be a new bug that just creep in. BACKGROUND: I have an "askyn.bat" that asks Yes/no questions. It has a "big" option to use VT100 double-height text. Starting this week, my "big" double-height questions started getting a newline inserted in between.... But only if I was at the very lowest row of the console when calling it. It looked like this: ![Image](https://github.com/user-attachments/assets/e7e91b19-4f22-400b-9f4b-47b6a072ca64) THE FIX: After some rather extensive testing, the solution was the very last thing I'd ever expect. **It was inserting a 1ms delay prior to the newline!!!!!!!!** ![Image](https://github.com/user-attachments/assets/ae378d58-eb87-4683-b4eb-39aa44426e11) Literally, remarking out the ```delay /m 1``` (one millisecond delay) changes the rendering from aforementioned screenshot to correct output: ![Image](https://github.com/user-attachments/assets/170bb39c-5450-4e60-98f8-6aff6b2b9f17) I sincerely doubt this is by design. I sincerely doubt that a 1 millisecond delay before outputting a newline should somehow change the ANSI rendering such that there is a phantom extra newline that appears out of nowhere. And one of the reasons for my sincere doubt is —— This is a script i've been using for a year. It just broke today. Consistently. FOR REFERENCE: "echos" is the same as echo, but without a newline at the end. "delay" is like unix's sleep, but accepts millisecond delays with the /m option. "big_top" and "big_bot" are the ansi codes for double-height text, top line and bottom line. Ansi_clear_to_end is simply to clear any screen garbage off from the right of the line. Ansi_save_position is the ansi code to save screen position, which I use to write "yes" "no" in the correct place once the user has responded to the Y/N prompt. ### Expected Behavior (See above) ### Actual Behavior (see above)
claunia added the Product-ConhostArea-OutputNeeds-TriageIssue-BugArea-VT labels 2026-01-31 08:13:16 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22441