Glyphs from U+f900 to U+fad9 have wrong extra space in certain condition when we use colors #17747

Open
opened 2026-01-31 05:52:12 +00:00 by claunia · 0 comments
Owner

Originally created by @ahmedwelhakim on GitHub (Jun 20, 2022).

Windows Terminal version

1.13.11432.0

Windows build number

10.0.22000.0

Other Software

No response

Steps to reproduce

First we need to install Nerd Font, (I tesed with FantasqueSansMono NF, and CaskaydiaCove NF)

After installing it and use the font in the Windows Terminal, then we can print any glyphs that there hex range from U+f900 to U+fad9 with any color and Then putting any character next to it BUT with different color.
The script code for that is very simple:

Method 1 using ANSI escape sequence color

$col = 15
for ($i = 0xf900-$col*3; $i -lt 0xfaff+$col*3; $i+=$j) {
    for($j = 0; $j - lt $col; $j++){
        Write-Host("{0}`e[38;2;0;255;10m{1}`e[0m{2}{3:x}   "  -f "[",[char]($i+$j), "]",($i+$j)) -NoNewLine 
    }
    Write-Host('')
}

OR

Method 2 using -ForegroundColor parameter

$col = 15
for ($i = 0xf900-$col*3; $i -lt 0xfaff+$col*3; $i+=$j) {
    for($j = 0;$j -lt $col ;$j++){
        Write-Host("{0}{1}" -f '(',[char]($i+$j)) -NoNewLine -ForegroundColor Red 
        Write-Host("{0}{1:x}  " -f ')', ($i + $j) ) -NoNewLine -ForegroundColor Green
    }
    Write-Host('')
}

Method 3 which is behaving half correctly but in certain condition

when we don't change the color and we must continue with the same color IF WE CHANGE IT the first character after changing the color will be spaced

$col = 15
for ($i = 0xf900-$col*3; $i -lt 0xfaff+$col*3; $i+=$j) {
    for($j = 0;$j -lt $col ;$j++){
        Write-Host("{0}`e[38;2;0;255;10m{1}{2}{3:x}   "  -f "[",[char]($i+$j), "]",($i+$j)) -NoNewLine 
    }
    Write-Host('')
}

Expected Behavior

Method 3 output :

method 3

Here as we can see when we don't change the color after the glyph so there is no space, and that should be the normal case even when we change the color.

BUT

if I change the color of hex there will be an extra space but before the hex not the square bracket as the square bracket with the same color of glyph as in the screen shots in the actual behavior down.

Actual Behavior

Method 1 Output

case1 method1

We can see here there is space after every glyph in first color transition.

Method 2 Output as above but with using -Foreground parameter.

case1 method2

shifting the space location by using same color of glyph then change it

case3

We can notice that the glyph is green colored and "]" is also green so no space between them when we change the color the space became before the changed text color

Here is another proof that it depends on changing the color

case 3 wrong

There should be no space between hex and "dummy"

Originally created by @ahmedwelhakim on GitHub (Jun 20, 2022). ### Windows Terminal version 1.13.11432.0 ### Windows build number 10.0.22000.0 ### Other Software _No response_ ### Steps to reproduce First we need to install Nerd Font, (I tesed with FantasqueSansMono NF, and CaskaydiaCove NF) After installing it and use the font in the Windows Terminal, then we can print any glyphs that there hex range from U+f900 to U+fad9 with any **color** and **Then** putting any character next to it **BUT** with different color. The script code for that is very simple: ## Method 1 using ANSI escape sequence color ``` $col = 15 for ($i = 0xf900-$col*3; $i -lt 0xfaff+$col*3; $i+=$j) { for($j = 0; $j - lt $col; $j++){ Write-Host("{0}`e[38;2;0;255;10m{1}`e[0m{2}{3:x} " -f "[",[char]($i+$j), "]",($i+$j)) -NoNewLine } Write-Host('') } ``` ### OR ## Method 2 using `-ForegroundColor` parameter ``` $col = 15 for ($i = 0xf900-$col*3; $i -lt 0xfaff+$col*3; $i+=$j) { for($j = 0;$j -lt $col ;$j++){ Write-Host("{0}{1}" -f '(',[char]($i+$j)) -NoNewLine -ForegroundColor Red Write-Host("{0}{1:x} " -f ')', ($i + $j) ) -NoNewLine -ForegroundColor Green } Write-Host('') } ``` ## Method 3 which is behaving half correctly **but in certain condition** when we don't change the color and we must continue with the same color **IF WE CHANGE IT** the first character after changing the color will be spaced ``` $col = 15 for ($i = 0xf900-$col*3; $i -lt 0xfaff+$col*3; $i+=$j) { for($j = 0;$j -lt $col ;$j++){ Write-Host("{0}`e[38;2;0;255;10m{1}{2}{3:x} " -f "[",[char]($i+$j), "]",($i+$j)) -NoNewLine } Write-Host('') } ``` ### Expected Behavior ## Method 3 output : ![method 3](https://user-images.githubusercontent.com/53128020/174503563-66f1b436-8400-48b0-89fa-f0ebb733d4c1.png) Here as we can see when we don't change the color after the glyph so there is no space, and that should be the normal case even when we change the color. ### BUT if I change the color of hex there will be an extra space but before the hex not the square bracket as the square bracket with the same color of glyph as in the screen shots in the actual behavior down. ### Actual Behavior ## Method 1 Output ![case1 method1](https://user-images.githubusercontent.com/53128020/174503001-c48dab7d-3fcf-4b24-94fb-b468469a99aa.png) We can see here there is space after every glyph in first color transition. ## Method 2 Output as above but with using `-Foreground` parameter. ![case1 method2](https://user-images.githubusercontent.com/53128020/174503056-0f9248ec-7470-43a1-b6a1-f2991b85b75c.png) ## shifting the space location by using same color of glyph then change it ![case3](https://user-images.githubusercontent.com/53128020/174503861-d3b5ddd9-1824-426b-8a3d-7403f11c1719.png) We can notice that the glyph is green colored and "]" is also green so no space between them when we change the color the space became before the changed text color ## Here is another proof that it depends on changing the color ![case 3 wrong](https://user-images.githubusercontent.com/53128020/174504072-63818086-fd77-4d22-91e5-894b7485915d.png) There should be no space between hex and "dummy"
claunia added the Issue-BugResolution-ExternalNeeds-Tag-Fix labels 2026-01-31 05:52:13 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17747