diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp index 6b59b612f245..236a2f090bc2 100644 --- a/lldb/tools/driver/Driver.cpp +++ b/lldb/tools/driver/Driver.cpp @@ -1611,6 +1611,15 @@ Driver::ReadyForCommand () } } +void +Driver::ResizeWindow (unsigned short col) +{ + GetDebugger().SetTerminalWidth (col); + if (m_io_channel_ap.get() != NULL) + { + m_io_channel_ap->ElResize(); + } +} void sigwinch_handler (int signo) @@ -1621,7 +1630,7 @@ sigwinch_handler (int signo) { if ((window_size.ws_col > 0) && g_driver != NULL) { - g_driver->GetDebugger().SetTerminalWidth (window_size.ws_col); + g_driver->ResizeWindow (window_size.ws_col); } } } diff --git a/lldb/tools/driver/Driver.h b/lldb/tools/driver/Driver.h index 2366854dd11d..357940be8e2c 100644 --- a/lldb/tools/driver/Driver.h +++ b/lldb/tools/driver/Driver.h @@ -151,6 +151,9 @@ public: { m_done = true; } + + void + ResizeWindow (unsigned short col); private: lldb::SBDebugger m_debugger; diff --git a/lldb/tools/driver/IOChannel.cpp b/lldb/tools/driver/IOChannel.cpp index 92bd3720fc73..247d930ca40a 100644 --- a/lldb/tools/driver/IOChannel.cpp +++ b/lldb/tools/driver/IOChannel.cpp @@ -90,6 +90,12 @@ IOChannel::ElCompletionFn (EditLine *e, int ch) } } +void +IOChannel::ElResize() +{ + el_resize(m_edit_line); +} + unsigned char IOChannel::HandleCompletion (EditLine *e, int ch) { diff --git a/lldb/tools/driver/IOChannel.h b/lldb/tools/driver/IOChannel.h index fbeaac4a8683..0a6b2d0ec656 100644 --- a/lldb/tools/driver/IOChannel.h +++ b/lldb/tools/driver/IOChannel.h @@ -104,6 +104,9 @@ public: static unsigned char ElCompletionFn (EditLine *e, int ch); + + void + ElResize(); protected: