From 507619dff2e87545db9dffc4e350daa22e77ac6d Mon Sep 17 00:00:00 2001 From: Jekyll Wu Date: Fri, 9 Mar 2012 15:16:42 +0800 Subject: [PATCH] Emit signal on receiving escape sequence for changing terminal size This is just one needed prerequisite for supporting the resizing escape sequence. I still have no clear clue of adding the support correctly --- src/Emulation.h | 6 ++++++ src/Session.cpp | 2 ++ src/Vt102Emulation.cpp | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Emulation.h b/src/Emulation.h index a95ca2e41..72dd88f97 100644 --- a/src/Emulation.h +++ b/src/Emulation.h @@ -375,6 +375,12 @@ signals: */ void imageSizeInitialized(); + /** + * Emitted after receiving the escape sequence which asks to change + * the terminal emulator's size + */ + void imageResizeRequest(const QSize& sizz); + /** * Emitted when the terminal program requests to change various properties * of the terminal display. diff --git a/src/Session.cpp b/src/Session.cpp index 83cb4f7fb..9056e8010 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -141,6 +141,8 @@ Session::Session(QObject* parent) : SLOT(onPrimaryScreenInUse(bool))); connect(_emulation, SIGNAL(selectedText(QString)), this, SLOT(onSelectedText(QString))); + connect( _emulation, SIGNAL(imageResizeRequest(QSize)) , this, + SIGNAL(resizeRequest(QSize)) ); //create new teletype for I/O with shell process openTeletype(-1); diff --git a/src/Vt102Emulation.cpp b/src/Vt102Emulation.cpp index beb9e96ed..1fead06b5 100644 --- a/src/Vt102Emulation.cpp +++ b/src/Vt102Emulation.cpp @@ -544,7 +544,9 @@ void Vt102Emulation::processToken(int token, int p, int q) case TY_ESC_DE('8' ) : _currentScreen->helpAlign ( ); break; // resize = \e[8;;t - case TY_CSI_PS('t', 8) : setImageSize( p /*lines */, q /* columns */ ); break; + case TY_CSI_PS('t', 8) : setImageSize( p /*lines */, q /* columns */ ); + emit imageResizeRequest(QSize(q, p)); + break; // change tab text color : \e[28;t color: 0-16,777,215 case TY_CSI_PS('t', 28) : emit changeTabTextColorRequest ( p ); break;