Description
Windows Terminal version
1.22.2362
Windows build number
10.0.19045
Other Software
No response
Steps to reproduce
Disable ENABLE_WRAP_AT_EOL_OUTPUT, keep ENABLE_PROCESSED_OUTPUT enabled, write to the end of line, then insert \n . Traditionally the newline would operate as CRLF (processed output semantics) and start at the beginning of the following line. Note this is Win32 semantics, VT semantics are different; in this sequence, VT support is not enabled.
In WT 1.22.x, this generates VT semantics. Replacing \n with \r\n works as expected.
#include <windows.h>
int main(int argc, char * argv[])
{
CONSOLE_SCREEN_BUFFER_INFO screenBufferInfo;
DWORD consoleWidth;
DWORD charIndex;
DWORD lineIndex;
DWORD charsWritten;
HANDLE consoleHandle;
LPSTR buffer;
consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(consoleHandle, &screenBufferInfo);
consoleWidth = screenBufferInfo.dwSize.X;
//
// Disable ENABLE_WRAP_AT_EOL_OUTPUT
//
SetConsoleMode(consoleHandle, ENABLE_PROCESSED_OUTPUT);
buffer = malloc(consoleWidth + 1);
for (lineIndex = 0; lineIndex < 3; lineIndex++) {
for (charIndex = 0; charIndex < consoleWidth; charIndex++) {
buffer[charIndex] = '1' + lineIndex;
}
WriteConsole(consoleHandle, buffer, consoleWidth, &charsWritten, NULL);
WriteConsole(consoleHandle, "\n", 1, &charsWritten, NULL);
}
return 0;
}
Expected Behavior
Behavior in WT 1.21, as well as Conhost, including OpenConsole from WT 1.22:
Actual Behavior
Behavior in WT 1.22: