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
This commit is contained in:
Mike Griese 2019-09-23 18:07:47 -04:00 committed by Dustin L. Howett (MSFT)
parent 277acc3383
commit 1c412d42b3

View file

@ -139,6 +139,17 @@ static bool s_IsOnDesktop()
reg.LoadFromRegistry(Title);
}
}
else
{
// microsoft/terminal#1965 - Let's just always enable VT processing by
// default for conpty clients. This prevents peculiar differences in
// behavior between conhost and terminal applications when the user has
// VirtualTerminalLevel=1 in their registry.
// We want everyone to be using VT by default anyways, so this is a
// strong nudge in that direction. If an application _doesn't_ want VT
// processing, it's free to disable this setting, even in conpty mode.
settings.SetVirtTermLevel(1);
}
// 1. The settings we were passed contains STARTUPINFO structure settings to be applied last.
settings.ApplyStartupInfo(pStartupSettings);