Skip to content

Commit 1c412d4

Browse files
zadjii-msftDHowett
authored andcommitted
Enable VT processing by default for ConPTY (#2824)
This change enables VT processing by default for _all_ conpty clients. See #1965 for a discussion on why we believe this is a righteous change. Also mentioned in the issue was the idea of only checking the `VirtualTerminalLevel` reg key in the conpty startup. I don't think this would be a more difficult change, looks like all we'd need is a simple `reg.LoadGlobalsFromRegistry();` call instead of this change. # Validation Steps Performed Manually launched a scratch app in both the terminal and the console. The console launch's output mode was 0x3, and the terminal's was 0x7. 0x4 is the ` ENABLE_VIRTUAL_TERMINAL_PROCESSING` flag, which the client now had by default in the Terminal. Closes #1965
1 parent 277acc3 commit 1c412d4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/host/srvinit.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,17 @@ static bool s_IsOnDesktop()
139139
reg.LoadFromRegistry(Title);
140140
}
141141
}
142+
else
143+
{
144+
// microsoft/terminal#1965 - Let's just always enable VT processing by
145+
// default for conpty clients. This prevents peculiar differences in
146+
// behavior between conhost and terminal applications when the user has
147+
// VirtualTerminalLevel=1 in their registry.
148+
// We want everyone to be using VT by default anyways, so this is a
149+
// strong nudge in that direction. If an application _doesn't_ want VT
150+
// processing, it's free to disable this setting, even in conpty mode.
151+
settings.SetVirtTermLevel(1);
152+
}
142153

143154
// 1. The settings we were passed contains STARTUPINFO structure settings to be applied last.
144155
settings.ApplyStartupInfo(pStartupSettings);

0 commit comments

Comments
 (0)