From f5b0fddfb865bb21baac98117da890ff0e32e806 Mon Sep 17 00:00:00 2001 From: James Holderness Date: Sun, 18 Feb 2024 16:18:19 +0000 Subject: [PATCH] Only propagate ED2 through conpty for the active buffer. --- src/terminal/adapter/adaptDispatch.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/terminal/adapter/adaptDispatch.cpp b/src/terminal/adapter/adaptDispatch.cpp index 3730e64c0b0a..3ddd6137d205 100644 --- a/src/terminal/adapter/adaptDispatch.cpp +++ b/src/terminal/adapter/adaptDispatch.cpp @@ -3391,8 +3391,10 @@ bool AdaptDispatch::_EraseAll() // terminal application. While we're in conpty mode, when the client // requests a Erase All operation, we need to manually tell the // connected terminal to do the same thing, so that the terminal will - // move it's own buffer contents into the scrollback. - return !inPtyMode; + // move it's own buffer contents into the scrollback. But this only + // applies if we're in the active buffer, since this should have no + // visible effect for an inactive buffer. + return !(inPtyMode && textBuffer.IsActiveBuffer()); } //Routine Description: