Do not output title escape sequences when WINPTY_FLAG_PLAIN_OUTPUT sets

This commit is contained in:
jackyzy823 2018-12-14 14:16:31 +08:00
parent afacf7792f
commit b60ded1cf2

View File

@ -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;
}
}