Skip to content

Terminating ANSI Escape Sequences with Semicolon #1005

@GaryDYelle

Description

@GaryDYelle

"OpenSSH for Windows" version
0.0.24.0

Server OperatingSystem
Windows 10 Pro

Client OperatingSystem
cmd.exe and Git for Windows 2.15.1.2

What is failing
Win32-OpenSSH converts all escape sequence and terminates them with a semicolon. This semicolon resets the color to white.

For example, Win32-OpenSSH converts the escape sequence for red \033[31mtest to \033[0;39;24;27;31;40;mtest (note the semicolon at the end) which is equivalent to \033[0mtest and resets the color to white.

Expected output
The text is displayed in red in PuTTY, mintty, and Windows 10 console.

Actual output

The text is displayed in white in PuTTY and mintty.

The text is displayed in red in the Windows 10 console due to another issue: microsoft/terminal#44

Steps to Reproduce Issue

CMD.exe

  • Do not set the registry key for the DefaultShell (i.e., the default shell is cmd.exe)
  • Enable logging in Putty ("All Session Output")
  • Open connection and log in
  • Write command color 04
  • Inspect Log File

bash.exe

  • Set the DefaultShell to C:\Program Files\Git\bin\bash.exe
  • Enable logging in Putty ("All Session Output")
  • Open connection and log in
  • Write command printf "\033[31;0mtest\n"
  • Inspect Log File

Further Information

https://superuser.com/questions/1280903/how-to-enable-colors-with-win32-openssh-and-putty

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions