Command prompt crashes when the window width is changed. #19131

Open
opened 2026-01-31 06:34:38 +00:00 by claunia · 0 comments
Owner

Originally created by @tyan0 on GitHub (Dec 24, 2022).

Windows Terminal version

N/A [Is this the right place to report a bug of conventional command prompt (not in Windows Terminal, not legacy mode)?]

Windows build number

10.0.19045.2364

Other Software

OS: Windows 10 Professional (Japanese, 64bit)
The test case: The following code.

Steps to reproduce

  1. Compile the following test case.
#include <windows.h>
#include <stdio.h>

int main()
{
	DWORD mode;
	GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), &mode);
	SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
	for (;;) {
		printf("\033[10;40H日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語");
	}
	return 0;
}
  1. Open command prompt window (cmd.exe).
  2. Execute the test case.
  3. Change the window width repeatedly.

Expected Behavior

Command prompt window stays opened, and window width is changed.

Actual Behavior

Command prompt window crashes. Even after window is closed, the test case is still running in background.

  • I confirmed this problem in Windows 10 2004, 21H2 and 22H2.
  • This does not seem to happen in Windows 11.
  • If the printed string is only ASCII chars (not multibyte), the problem does not occur.
Originally created by @tyan0 on GitHub (Dec 24, 2022). ### Windows Terminal version N/A [Is this the right place to report a bug of conventional command prompt (not in Windows Terminal, not legacy mode)?] ### Windows build number 10.0.19045.2364 ### Other Software OS: Windows 10 Professional (Japanese, 64bit) The test case: The following code. ### Steps to reproduce 1) Compile the following test case. ``` #include <windows.h> #include <stdio.h> int main() { DWORD mode; GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), &mode); SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING); for (;;) { printf("\033[10;40H日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語日本語"); } return 0; } ``` 2) Open command prompt window (cmd.exe). 3) Execute the test case. 4) Change the window width repeatedly. ### Expected Behavior Command prompt window stays opened, and window width is changed. ### Actual Behavior Command prompt window crashes. Even after window is closed, the test case is still running in background. - I confirmed this problem in Windows 10 2004, 21H2 and 22H2. - This does not seem to happen in Windows 11. - If the printed string is only ASCII chars (not multibyte), the problem does not occur.
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 06:34:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19131