From 0d6dba53c556bb107a32abbb5b1df461a13990d8 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Tue, 28 Apr 2020 08:14:30 -0500 Subject: [PATCH] This is the fix for #1856 --- src/host/getset.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/host/getset.cpp b/src/host/getset.cpp index c8d81f92670..0c96032d4aa 100644 --- a/src/host/getset.cpp +++ b/src/host/getset.cpp @@ -589,7 +589,15 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont if (NewSize.X != context.GetViewport().Width() || NewSize.Y != context.GetViewport().Height()) { + // GH#1856 - make sure to hide the commandline _before_ we execute + // the resize, and the re-display it after the resize. If we leave + // it displayed, we'll crash during the resize when we try to figure + // out if the bounds of the old commandline fit within the new + // window (it might not). + CommandLine& commandLine = CommandLine::Instance(); + commandLine.Hide(FALSE); context.SetViewportSize(&NewSize); + commandLine.Show(); IConsoleWindow* const pWindow = ServiceLocator::LocateConsoleWindow(); if (pWindow != nullptr)