diff --git a/src/cascadia/TerminalControl/ControlCore.cpp b/src/cascadia/TerminalControl/ControlCore.cpp index b46da5236af..7826e7d7906 100644 --- a/src/cascadia/TerminalControl/ControlCore.cpp +++ b/src/cascadia/TerminalControl/ControlCore.cpp @@ -483,6 +483,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation { // Ask the hosting application to give us a new connection. RestartTerminalRequested.raise(*this, nullptr); + _terminal->HardReset(); return true; } } diff --git a/src/cascadia/TerminalCore/Terminal.cpp b/src/cascadia/TerminalCore/Terminal.cpp index c77ab1ab764..0eaac979fab 100644 --- a/src/cascadia/TerminalCore/Terminal.cpp +++ b/src/cascadia/TerminalCore/Terminal.cpp @@ -71,6 +71,14 @@ void Terminal::CreateFromSettings(ICoreSettings settings, UpdateSettings(settings); } +void Terminal::HardReset() +{ + + IStateMachineEngine& baseEngine = _stateMachine->Engine(); + const auto lock = LockForReading(); + baseEngine.ActionEscDispatch(VTID("c")); +} + // Method Description: // - Update our internal properties to match the new values in the provided // CoreSettings object. diff --git a/src/cascadia/TerminalCore/Terminal.hpp b/src/cascadia/TerminalCore/Terminal.hpp index 8ac499c97e2..1b9a7b4c33b 100644 --- a/src/cascadia/TerminalCore/Terminal.hpp +++ b/src/cascadia/TerminalCore/Terminal.hpp @@ -5,6 +5,7 @@ #include +#include "../../terminal/adapter/adaptDispatch.hpp" #include "../../inc/DefaultSettings.h" #include "../../buffer/out/textBuffer.hpp" #include "../../renderer/inc/IRenderData.hpp" @@ -177,6 +178,8 @@ class Microsoft::Terminal::Core::Terminal final : void UserScrollViewport(const int viewTop) override; int GetScrollOffset() noexcept override; + void HardReset(); + void TrySnapOnInput() override; bool IsTrackingMouseInput() const noexcept; bool ShouldSendAlternateScroll(const unsigned int uiButton, const int32_t delta) const noexcept;