From b60ded1cf207f21ccad064ce14db45d42caa27e7 Mon Sep 17 00:00:00 2001 From: jackyzy823 Date: Fri, 14 Dec 2018 14:16:31 +0800 Subject: [PATCH] Do not output title escape sequences when WINPTY_FLAG_PLAIN_OUTPUT sets --- src/agent/Agent.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/agent/Agent.cc b/src/agent/Agent.cc index a3ab21b..986edea 100644 --- a/src/agent/Agent.cc +++ b/src/agent/Agent.cc @@ -602,9 +602,11 @@ void Agent::syncConsoleTitle() { std::wstring newTitle = m_console.title(); if (newTitle != m_currentTitle) { - std::string command = std::string("\x1b]0;") + - utf8FromWide(newTitle) + "\x07"; - m_conoutPipe->write(command.c_str()); + if (!m_plainMode && !m_conoutPipe->isClosed()) { + std::string command = std::string("\x1b]0;") + + utf8FromWide(newTitle) + "\x07"; + m_conoutPipe->write(command.c_str()); + } m_currentTitle = newTitle; } }