Skip to content

Commit

Permalink
Make conpty request win32-input-mode on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
zadjii-msft committed May 13, 2020
1 parent 583a3d2 commit 2699f89
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/host/VtIo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ bool VtIo::IsUsingVt() const
CATCH_RETURN();
}

LOG_IF_FAILED(_pVtRenderEngine->RequestWin32Input());

// MSFT: 15813316
// If the terminal application wants us to inherit the cursor position,
// we're going to emit a VT sequence to ask for the cursor position, then
Expand Down
11 changes: 11 additions & 0 deletions src/renderer/vt/VtSequences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,3 +436,14 @@ using namespace Microsoft::Console::Render;
{
return _Write("\x1b[29m");
}

// Method Description:
// - TODO
// Arguments:
// - <none>
// Return Value:
// - S_OK if we succeeded, else an appropriate HRESULT for failing to allocate or write.
[[nodiscard]] HRESULT VtEngine::_RequestWin32Input() noexcept
{
return _Write("\x1b]1000;1;1\x07");
}
13 changes: 13 additions & 0 deletions src/renderer/vt/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,3 +509,16 @@ void VtEngine::SetResizeQuirk(const bool resizeQuirk)
{
return S_OK;
}

// Method Description:
// - TODO
// Arguments:
// - <none>
// Return Value:
// - S_OK if we succeeded, else an appropriate HRESULT for failing to allocate or write.
HRESULT VtEngine::RequestWin32Input() noexcept
{
RETURN_IF_FAILED(_RequestWin32Input());
RETURN_IF_FAILED(_Flush());
return S_OK;
}
4 changes: 4 additions & 0 deletions src/renderer/vt/vtrenderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ namespace Microsoft::Console::Render

[[nodiscard]] virtual HRESULT ManuallyClearScrollback() noexcept;

[[nodiscard]] HRESULT RequestWin32Input() noexcept;

protected:
wil::unique_hfile _hFile;
std::string _buffer;
Expand Down Expand Up @@ -208,6 +210,8 @@ namespace Microsoft::Console::Render

[[nodiscard]] HRESULT _RequestCursor() noexcept;

[[nodiscard]] HRESULT _RequestWin32Input() noexcept;

[[nodiscard]] virtual HRESULT _MoveCursor(const COORD coord) noexcept = 0;
[[nodiscard]] HRESULT _RgbUpdateDrawingBrushes(const COLORREF colorForeground,
const COLORREF colorBackground,
Expand Down

1 comment on commit 2699f89

@github-actions

This comment was marked as outdated.

Please sign in to comment.