Skip to content

Commit

Permalink
Enable VT processing by default for ConPTY (#2824)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zadjii-msft authored and DHowett committed Sep 23, 2019
1 parent 277acc3 commit 1c412d4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/host/srvinit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1c412d4

Please sign in to comment.