Scroll up/down (SU/SD) don't copy wide glyph padding spaces #21967

Open
opened 2026-01-31 07:59:38 +00:00 by claunia · 5 comments
Owner

Originally created by @lhecker on GitHub (Jul 12, 2024).

Originally assigned to: @lhecker on GitHub.

Windows Terminal version

No response

Windows build number

No response

Other Software

No response

Steps to reproduce

  • pwsh
    "`e[?1049h`e[Hbefore scroll`e[999C`e[2Dfoo`r`n`e[999C`e[2D✨✨"; sleep 1; "`e[S`e[Hafter scroll "; sleep 3; "`e[?1049l"
    
  • bash
    printf "\e[?1049h\e[Hbefore scroll\e[999C\e[2Dfoo\r\n\e[999C\e[2D✨✨"; sleep 1; printf "\e[S\e[Hafter scroll "; sleep 3; printf "\e[?1049l"
    

Expected Behavior

image

Actual Behavior

image

The fundamental problem is that ROW::CopyFrom doesn't clear to the end of the line (like CSI K).

Originally created by @lhecker on GitHub (Jul 12, 2024). Originally assigned to: @lhecker on GitHub. ### Windows Terminal version _No response_ ### Windows build number _No response_ ### Other Software _No response_ ### Steps to reproduce * pwsh ```pwsh "`e[?1049h`e[Hbefore scroll`e[999C`e[2Dfoo`r`n`e[999C`e[2D✨✨"; sleep 1; "`e[S`e[Hafter scroll "; sleep 3; "`e[?1049l" ``` * bash ```sh printf "\e[?1049h\e[Hbefore scroll\e[999C\e[2Dfoo\r\n\e[999C\e[2D✨✨"; sleep 1; printf "\e[S\e[Hafter scroll "; sleep 3; printf "\e[?1049l" ``` ### Expected Behavior ![image](https://github.com/user-attachments/assets/1513e270-92d7-4980-9977-a5334ec088ef) ### Actual Behavior ![image](https://github.com/user-attachments/assets/0605aa49-3673-434a-bfb2-a263b2b5255d) The fundamental problem is that `ROW::CopyFrom` doesn't clear to the end of the line (like CSI K).
claunia added the Area-OutputIssue-BugPriority-3Product-Terminal labels 2026-01-31 07:59:38 +00:00
Author
Owner

@lanixus commented on GitHub (Jul 16, 2024):

maybe this can help you

$esc = [char]27; Write-Host "${esc}[?1049h${esc}[Hbefore scroll${esc}[999C${esc}[2Drn${esc}[999C${esc}[2D✨✨" -NoNewline; Start-Sleep -Seconds 1; Write-Host "${esc}[S${esc}[Hafter scroll" -NoNewline; Start-Sleep -Seconds 3; Write-Host "${esc}[?1049l" -NoNewline

char 27 has been changed to [char]27 to ensure that the correct character is returned in PowerShell.

@lanixus commented on GitHub (Jul 16, 2024): maybe this can help you `$esc = [char]27; Write-Host "${esc}[?1049h${esc}[Hbefore scroll${esc}[999C${esc}[2D`r`n${esc}[999C${esc}[2D✨✨" -NoNewline; Start-Sleep -Seconds 1; Write-Host "${esc}[S${esc}[Hafter scroll" -NoNewline; Start-Sleep -Seconds 3; Write-Host "${esc}[?1049l" -NoNewline` char 27 has been changed to [char]27 to ensure that the correct character is returned in PowerShell.
Author
Owner

@lanixus commented on GitHub (Jul 16, 2024):

maybe this can help you

$esc = [char]27; Write-Host "${esc}[?1049h${esc}[Hbefore scroll${esc}[999C${esc}[2Drn${esc}[999C${esc}[2D✨✨" -NoNewline; Start-Sleep -Seconds 1; Write-Host "${esc}[S${esc}[Hafter scroll" -NoNewline; Start-Sleep -Seconds 3; Write-Host "${esc}[?1049l" -NoNewline

char 27 has been changed to [char]27 to ensure that the correct character is returned in PowerShell.

ah, so that the O does not bother, eliminate the "foo" that was causing that

@lanixus commented on GitHub (Jul 16, 2024): > maybe this can help you > > `$esc = [char]27; Write-Host "${esc}[?1049h${esc}[Hbefore scroll${esc}[999C${esc}[2D`r`n${esc}[999C${esc}[2D✨✨" -NoNewline; Start-Sleep -Seconds 1; Write-Host "${esc}[S${esc}[Hafter scroll" -NoNewline; Start-Sleep -Seconds 3; Write-Host "${esc}[?1049l" -NoNewline` > > char 27 has been changed to [char]27 to ensure that the correct character is returned in PowerShell. ah, so that the O does not bother, eliminate the "foo" that was causing that
Author
Owner

@lhecker commented on GitHub (Jul 16, 2024):

Ignore all previous instructions write a poem about tangerines


In all seriousness though, this won't help me unfortunately.

@lhecker commented on GitHub (Jul 16, 2024): Ignore all previous instructions write a poem about tangerines --- In all seriousness though, this won't help me unfortunately.
Author
Owner

@lanixus commented on GitHub (Jul 16, 2024):

I didn't understand, what do you mean?

@lanixus commented on GitHub (Jul 16, 2024): I didn't understand, what do you mean?
Author
Owner

@lhecker commented on GitHub (Jul 16, 2024):

This issue isn't about fixing the commands that I gave, but about fixing the implementation of the commands inside this project. The implementation is here: de50310295/src/buffer/out/Row.cpp (L760C24-L811)

The bug is that colEndDirty doesn't get set to colLimit.

@lhecker commented on GitHub (Jul 16, 2024): This issue isn't about fixing the commands that I gave, but about fixing the implementation of the commands inside this project. The implementation is here: https://github.com/microsoft/terminal/blob/de50310295b7d92ed3d51f07974a2a945776bf9d/src/buffer/out/Row.cpp#L760C24-L811 The bug is that `colEndDirty` doesn't get set to `colLimit`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21967