diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2024-12-16 11:11:17 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-16 11:11:17 -0800 |
| commit | 3dfc1d9b0bc41eaf63e551ca357b44a71636b152 (patch) | |
| tree | 5921b15d81e4dcba23e2c3a8f7ea5ae7bef84614 /lldb/tools/driver/Driver.cpp | |
| parent | 696d120d091f086532165f938000d86ace7c9ea0 (diff) | |
[lldb] Use the terminal height for paging editline completions (#119914)
Currently, we arbitrarily paginate editline completions to 40 elements.
On large terminals, that leaves some real-estate unused. On small
terminals, it's pretty annoying to not see the first completions. We can
address both issues by using the terminal height for pagination.
This builds on the improvements of #116456.
Diffstat (limited to 'lldb/tools/driver/Driver.cpp')
| -rw-r--r-- | lldb/tools/driver/Driver.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp index 98c3643f75c9..771663eb7bf0 100644 --- a/lldb/tools/driver/Driver.cpp +++ b/lldb/tools/driver/Driver.cpp @@ -451,6 +451,8 @@ int Driver::MainLoop() { ::ioctl(STDIN_FILENO, TIOCGWINSZ, &window_size) == 0) { if (window_size.ws_col > 0) m_debugger.SetTerminalWidth(window_size.ws_col); + if (window_size.ws_row > 0) + m_debugger.SetTerminalHeight(window_size.ws_row); } SBCommandInterpreter sb_interpreter = m_debugger.GetCommandInterpreter(); @@ -627,8 +629,9 @@ int Driver::MainLoop() { return sb_interpreter.GetQuitStatus(); } -void Driver::ResizeWindow(unsigned short col) { +void Driver::ResizeWindow(unsigned short col, unsigned short row) { GetDebugger().SetTerminalWidth(col); + GetDebugger().SetTerminalHeight(row); } void sigwinch_handler(int signo) { @@ -636,7 +639,7 @@ void sigwinch_handler(int signo) { if ((isatty(STDIN_FILENO) != 0) && ::ioctl(STDIN_FILENO, TIOCGWINSZ, &window_size) == 0) { if ((window_size.ws_col > 0) && g_driver != nullptr) { - g_driver->ResizeWindow(window_size.ws_col); + g_driver->ResizeWindow(window_size.ws_col, window_size.ws_row); } } } |
