Skip to content

Commit

Permalink
I think this is the rest of the cleanup needed for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed May 14, 2020
1 parent fe44dd5 commit 5fc00d5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/cascadia/TerminalCore/TerminalDispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,11 @@ bool TerminalDispatch::SetCursorKeysMode(const bool applicationMode) noexcept
return true;
}

// Method Description
// - TODO
// Method Description:
// - win32-input-mode: Enable sending full input records encoded as a string of
// characters to the client application.
// Arguments:
// - applicationMode - set to true to enable Application Mode Input, false for Numeric Mode Input.
// - win32InputMode - set to true to enable win32-input-mode, false to disable.
// Return Value:
// - True if handled successfully. False otherwise.
bool TerminalDispatch::EnableWin32InputMode(const bool win32Mode) noexcept
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/vt/VtSequences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,10 @@ using namespace Microsoft::Console::Render;
}

// Method Description:
// - TODO
// - Send a sequence to the connected terminal to request win32-input-mode from
// them. This will enable the connected terminal to send us full INPUT_RECORDs
// as input. If the terminal doesn't understand this sequence, it'll just
// ignore it.
// Arguments:
// - <none>
// Return Value:
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/vt/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,10 @@ void VtEngine::SetResizeQuirk(const bool resizeQuirk)
}

// Method Description:
// - TODO
// - Send a sequence to the connected terminal to request win32-input-mode from
// them. This will enable the connected terminal to send us full INPUT_RECORDs
// as input. If the terminal doesn't understand this sequence, it'll just
// ignore it.
// Arguments:
// - <none>
// Return Value:
Expand Down
9 changes: 5 additions & 4 deletions src/terminal/adapter/InteractDispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ bool InteractDispatch::WriteInput(std::deque<std::unique_ptr<IInputEvent>>& inpu
}

// Method Description:
// - Writes a Ctrl-C event to the host. The host will then decide what to do
// with it, including potentially sending an interrupt to a client
// application.
// - Writes a key event to the host in a fashion that will enable the host to
// process special keys such as Ctrl-C or Ctrl+Break. The host will then
// decide what to do with it, including potentially sending an interrupt to a
// client application.
// Arguments:
// TODO
// - event: The key to send to the host.
// Return Value:
// True if handled successfully. False otherwise.
bool InteractDispatch::WriteCtrlKey(const KeyEvent& event)
Expand Down
11 changes: 10 additions & 1 deletion src/terminal/parser/InputStateMachineEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,16 @@ bool InputStateMachineEngine::ActionCsiDispatch(const wchar_t wch,
const std::basic_string_view<size_t> parameters)
{
const auto actionCode = static_cast<CsiActionCodes>(wch);
if (_pDispatch->IsVtInputEnabled() && _pfnFlushToInputQueue && actionCode != CsiActionCodes::Win32KeyboardInput)

// GH#4999 - If the client was in VT input mode, but we received a
// win32-input-mode sequence, then _don't_ passthrough the sequence to the
// client. It's impossibly unlikely that the client actually wanted
// win32-input-mode, and if they did, then we'll just translate the
// INPUT_RECORD back to the same sequence we say here later on, when the
// client reads it.
if (_pDispatch->IsVtInputEnabled() &&
_pfnFlushToInputQueue &&
actionCode != CsiActionCodes::Win32KeyboardInput)
{
return _pfnFlushToInputQueue();
}
Expand Down

0 comments on commit 5fc00d5

Please sign in to comment.