Parameter values of more than 5 digits are not supported #531

Open
opened 2026-01-30 21:54:29 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (Jan 21, 2019).

Originally assigned to: @j4james, @zadjii-msft on GitHub.

  • Your Windows build number:

Microsoft Windows [Version 10.0.17763.195]

  • What you're doing and what's happening:

I was trying to see how well the October update of the console dealt with Vttest, and also determine the cause of any failures. In most cases it was just a matter of missing functionality (which I can understand might not be a priority), but the "leading zeros" test (the last screen of the "Test of cursor movements") feels like it could be a bug.

The point of the test was to determine whether leading zeros were supported in parameter values. And while the Windows console does handle them some of the time, it fails when the parameter value is more than 5 digits long. For example, consider these two sequences for setting the text color to green:

printf "\033[00032mGREEN\033[m\n"
printf "\033[000032mGREEN?\033[m\n"

The first one works (3 leading zeros, total length 5), but the second one fails (4 leading zeros, total length 6). This is a screenshot of those sequences in the WSL bash shell:

image

And for comparison, this is what they look like in XTerm:

image

Most of the time I'd expect this kind of edge case to be handled differently by everyone, and not worth worrying about, but this is one case that actually seems to be quite consistently implemented - every terminal emulator I've tried has supported an unlimited number of leading zeros.

  • What's wrong / what should be happening instead:

I'd expect the console to handle any number of leading zeros in an escape sequence parameter value. 11 digits ought to be enough to pass the current version of Vttest, but I think it would be preferable if there were no limit to the length, since that's what everyone else seems to support.

Originally created by @j4james on GitHub (Jan 21, 2019). Originally assigned to: @j4james, @zadjii-msft on GitHub. * Your Windows build number: Microsoft Windows [Version 10.0.17763.195] * What you're doing and what's happening: I was trying to see how well the October update of the console dealt with [Vttest](https://invisible-island.net/vttest/vttest.html), and also determine the cause of any failures. In most cases it was just a matter of missing functionality (which I can understand might not be a priority), but the "leading zeros" test (the last screen of the "Test of cursor movements") feels like it could be a bug. The point of the test was to determine whether leading zeros were supported in parameter values. And while the Windows console does handle them some of the time, it fails when the parameter value is more than 5 digits long. For example, consider these two sequences for setting the text color to green: printf "\033[00032mGREEN\033[m\n" printf "\033[000032mGREEN?\033[m\n" The first one works (3 leading zeros, total length 5), but the second one fails (4 leading zeros, total length 6). This is a screenshot of those sequences in the WSL bash shell: ![image](https://user-images.githubusercontent.com/4181424/51447598-b46ce700-1d17-11e9-8f7f-3cc52cd2c7a5.png) And for comparison, this is what they look like in XTerm: ![image](https://user-images.githubusercontent.com/4181424/51447613-d2d2e280-1d17-11e9-8766-df966fb33554.png) Most of the time I'd expect this kind of edge case to be handled differently by everyone, and not worth worrying about, but this is one case that actually seems to be quite consistently implemented - every terminal emulator I've tried has supported an unlimited number of leading zeros. * What's wrong / what should be happening instead: I'd expect the console to handle any number of leading zeros in an escape sequence parameter value. 11 digits ought to be enough to pass the current version of Vttest, but I think it would be preferable if there were no limit to the length, since that's what everyone else seems to support.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#531