diff --git a/lib/qtermwidget.cpp b/lib/qtermwidget.cpp index e1ee4b3..ccabfd1 100644 --- a/lib/qtermwidget.cpp +++ b/lib/qtermwidget.cpp @@ -751,3 +751,11 @@ int QTermWidget::getMargin() const { return m_impl->m_terminalDisplay->margin(); } + +void QTermWidget::saveHistory(QIODevice *device) +{ + QTextStream stream(device); + PlainTextDecoder decoder; + decoder.begin(&stream); + m_impl->m_session->emulation()->writeToStream(&decoder, 0, m_impl->m_session->emulation()->lineCount()); +} diff --git a/lib/qtermwidget.h b/lib/qtermwidget.h index e9447df..1a8d3a3 100644 --- a/lib/qtermwidget.h +++ b/lib/qtermwidget.h @@ -287,6 +287,7 @@ public slots: void toggleShowSearchBar(); + void saveHistory(QIODevice *device); protected: void resizeEvent(QResizeEvent *) override;