forked from qt-creator/qt-creator
Terminal: Ignore "height = 0" resize events
ConPTY on windows will send "clear line" characters in response to resizing the PTY. During re-showing the terminal pane the widget receives a "height=0" resize event. We have to ignore this otherwise the conpty might try to clear the screen. Another issue was that we are calling resize on the pty even thought the process has ended and won't be able to respond to the clear attempty by the pty anymore. Fixes: QTCREATORBUG-30523 Change-Id: I24caeaffb31d255a0640952e2d35bda23fd16280 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user