Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure Terminal state machine always accepts C1 controls #13969

Merged
1 commit merged into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cascadia/TerminalCore/Terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void Terminal::Create(til::size viewportSize, til::CoordType scrollbackLines, Re
// But if they are being accepted by conhost, there's a chance they may get
// passed through in some situations, so it's important that our state
// machine is always prepared to accept them.
_stateMachine->SetParserMode(StateMachine::Mode::AcceptC1, true);
_stateMachine->SetParserMode(StateMachine::Mode::AlwaysAcceptC1, true);
}

// Method Description:
Expand Down
2 changes: 1 addition & 1 deletion src/terminal/parser/stateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@ void StateMachine::ProcessCharacter(const wchar_t wch)
// code points that get translated as C1 controls when that is not their
// intended use. In order to avoid them triggering unintentional escape
// sequences, we ignore these characters by default.
if (_parserMode.test(Mode::AcceptC1))
if (_parserMode.any(Mode::AcceptC1, Mode::AlwaysAcceptC1))
{
ProcessCharacter(AsciiChars::ESC);
ProcessCharacter(_c1To7Bit(wch));
Expand Down
1 change: 1 addition & 0 deletions src/terminal/parser/stateMachine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ namespace Microsoft::Console::VirtualTerminal
enum class Mode : size_t
{
AcceptC1,
AlwaysAcceptC1,
Ansi,
};

Expand Down