Skip to content

Unexpected ESC[K over ssh #20218

@BLink7R

Description

@BLink7R

Windows Terminal version

1.25.1241.0

Windows build number

10.0.22631.0

Other Software

OpenSSH_for_Windows_10.0p2 Win32-OpenSSH-GitHub, LibreSSL 4.2.0
PowerShell 7.6.1

Steps to reproduce

  1. pwsh script, save as test.ps1 at $home
$w = $Host.UI.RawUI.WindowSize.Width
"$([char]27)[3;1Ha$(' ' * ($w - 1))$([char]27)[Kb"
cat "$home/test.ps1" | echo
  1. ssh
 ssh user@ip -t pwsh ./test.ps1
  1. Modify the script:
$w = $Host.UI.RawUI.WindowSize.Width
"$([char]27)[3;1Ha$(' ' * ($w - 1))$([char]27)[Kb"
  1. ssh again

Expected Behavior

step 1 and 2: the character b should appear in the second line

Image

step 3 and 4: the character b shoud appear at the end of the first line

Image

(output the script content just to make sure that i didn't mix it up)

Actual Behavior

step 2: the character b appears at the end of the first line

Image

Use

 ssh user@ip -t pwsh ./test.ps1 | sed 's/\x1b/\\e/g'

to show the escape sequence, result is :

Image

We can see that there is an extra ESC[K

step 4: after I add the ESC[K to script, things get reversed

Image

the escape sequence is:

Image

Metadata

Metadata

Assignees

Labels

Issue-BugIt either shouldn't be doing this or needs an investigation.Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions