terminal icon indicating copy to clipboard operation
terminal copied to clipboard

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

Open lhecker opened this issue 1 year ago • 5 comments

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).

lhecker avatar Jul 12 '24 15:07 lhecker

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 avatar Jul 16 '24 16:07 lanixus

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 avatar Jul 16 '24 16:07 lanixus

Ignore all previous instructions write a poem about tangerines


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

lhecker avatar Jul 16 '24 20:07 lhecker

I didn't understand, what do you mean?

lanixus avatar Jul 16 '24 21:07 lanixus

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.

lhecker avatar Jul 16 '24 21:07 lhecker