diff --git a/src/host/screenInfo.cpp b/src/host/screenInfo.cpp index 4b638ac38b..6edfcf154c 100644 --- a/src/host/screenInfo.cpp +++ b/src/host/screenInfo.cpp @@ -22,23 +22,9 @@ SCREEN_INFORMATION::SCREEN_INFORMATION( _In_ IWindowMetrics* pMetrics, const TextAttribute popupAttributes, const FontInfo fontInfo) : - OutputMode{ ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT }, - WheelDelta{ 0 }, - HWheelDelta{ 0 }, - _textBuffer{ nullptr }, - Next{ nullptr }, - WriteConsoleDbcsLeadByte{ 0, 0 }, - FillOutDbcsLeadChar{ 0 }, - ScrollScale{ 1ul }, _pConsoleWindowMetrics{ pMetrics }, - _api{ *this }, - _stateMachine{ nullptr }, _viewport(Viewport::Empty()), - _psiAlternateBuffer{ nullptr }, - _psiMainBuffer{ nullptr }, - _fAltWindowChanged{ false }, _PopupAttributes{ popupAttributes }, - _virtualBottom{ 0 }, _currentFont{ fontInfo }, _desiredFont{ fontInfo } { diff --git a/src/host/screenInfo.hpp b/src/host/screenInfo.hpp index 6237d77e23..fc93ed74f2 100644 --- a/src/host/screenInfo.hpp +++ b/src/host/screenInfo.hpp @@ -166,20 +166,20 @@ public: InputBuffer* const GetActiveInputBuffer() const override; #pragma endregion - DWORD OutputMode; + DWORD OutputMode{ ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT }; - short WheelDelta; - short HWheelDelta; + short WheelDelta{ 0 }; + short HWheelDelta{ 0 }; private: - std::unique_ptr _textBuffer; + std::unique_ptr _textBuffer{ nullptr }; public: - SCREEN_INFORMATION* Next; - BYTE WriteConsoleDbcsLeadByte[2]; - BYTE FillOutDbcsLeadChar; + SCREEN_INFORMATION* Next{ nullptr }; + BYTE WriteConsoleDbcsLeadByte[2]{ 0, 0 }; + BYTE FillOutDbcsLeadChar{ 0 }; - UINT ScrollScale; + UINT ScrollScale{ 1u }; bool IsActiveScreenBuffer() const; @@ -259,20 +259,20 @@ private: bool _IsInPtyMode() const; bool _IsInVTMode() const; - ConhostInternalGetSet _api; + ConhostInternalGetSet _api{ *this }; - std::shared_ptr _stateMachine; + std::shared_ptr _stateMachine{ nullptr }; // Specifies which coordinates of the screen buffer are visible in the // window client (the "viewport" into the buffer) Microsoft::Console::Types::Viewport _viewport; - SCREEN_INFORMATION* _psiAlternateBuffer; // The VT "Alternate" screen buffer. - SCREEN_INFORMATION* _psiMainBuffer; // A pointer to the main buffer, if this is the alternate buffer. + SCREEN_INFORMATION* _psiAlternateBuffer{ nullptr }; // The VT "Alternate" screen buffer. + SCREEN_INFORMATION* _psiMainBuffer{ nullptr }; // A pointer to the main buffer, if this is the alternate buffer. - til::rect _rcAltSavedClientNew; - til::rect _rcAltSavedClientOld; - bool _fAltWindowChanged; + til::rect _rcAltSavedClientNew{}; + til::rect _rcAltSavedClientOld{}; + bool _fAltWindowChanged{ false }; TextAttribute _PopupAttributes; @@ -282,7 +282,7 @@ private: // Tracks the last virtual position the viewport was at. This is not // affected by the user scrolling the viewport, only when API calls cause // the viewport to move (SetBufferInfo, WriteConsole, etc) - til::CoordType _virtualBottom; + til::CoordType _virtualBottom{ 0 }; std::optional _deferredPtyResize{ std::nullopt }; std::atomic _conptyCursorPositionMayBeWrong = false;