diff --git a/src/libs/solutions/terminal/terminalview.cpp b/src/libs/solutions/terminal/terminalview.cpp index 0cebe6d9b99..472346b3fcb 100644 --- a/src/libs/solutions/terminal/terminalview.cpp +++ b/src/libs/solutions/terminal/terminalview.cpp @@ -958,11 +958,14 @@ void TerminalView::applySizeChange() }; if (newLiveSize.height() <= 0) - newLiveSize.setHeight(1); + return; if (newLiveSize.width() <= 0) newLiveSize.setWidth(1); + if (d->m_surface->liveSize() == newLiveSize) + return; + resizePty(newLiveSize); d->m_surface->resize(newLiveSize); flushVTerm(true); diff --git a/src/plugins/terminal/terminalwidget.cpp b/src/plugins/terminal/terminalwidget.cpp index 2bd0fa403dd..756f1a11bee 100644 --- a/src/plugins/terminal/terminalwidget.cpp +++ b/src/plugins/terminal/terminalwidget.cpp @@ -336,7 +336,7 @@ qint64 TerminalWidget::writeToPty(const QByteArray &data) void TerminalWidget::resizePty(QSize newSize) { - if (m_process && m_process->ptyData()) + if (m_process && m_process->ptyData() && m_process->isRunning()) m_process->ptyData()->resize(newSize); }