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

Mark ESC as handled so that it doesn't come back in CharacterHandler #1974

Merged
merged 3 commits into from
Jul 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions src/cascadia/TerminalCore/Terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,14 @@ bool Terminal::SendKeyEvent(const WORD vkey, const DWORD modifiers)
ch = UNICODE_SPACE;
}

// Manually handle Escape here. If we let it fall through, it'll come
// back up through the character handler. It's registered as a translation
// in TerminalInput, so we'll let TerminalInput control it.
if (vkey == VK_ESCAPE)
{
ch = UNICODE_ESC;
}

keyEv.SetCharData(ch);

const bool manuallyHandled = ch != UNICODE_NULL;
Expand Down
1 change: 1 addition & 0 deletions src/inc/unicode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Author(s):

// UNICODE_NULL is a Windows macro definition
const wchar_t UNICODE_BACKSPACE = 0x8;
const wchar_t UNICODE_ESC = 0x1b;
const wchar_t UNICODE_DEL = 0x7f;
// NOTE: This isn't actually a backspace. It's a graphical block. But
// I believe it's emitted by one of our ANSI/OEM --> Unicode conversions.
Expand Down