diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-08-17 18:05:29 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-17 17:44:02 +0200 |
commit | c96b9fdb0a1962d67cde66842d7ab2a70f374e82 (patch) | |
tree | 5c79976a2ff79aa2251c8f3423ea84a100804b8b /Libraries | |
parent | fbc3b8e3c8f10c744779b43e9e30d89b999a57e2 (diff) | |
download | serenity-c96b9fdb0a1962d67cde66842d7ab2a70f374e82.zip |
LibLine: Add a getter for num_lines/num_cols
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibLine/Editor.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibLine/Editor.h b/Libraries/LibLine/Editor.h index 03e2a0acf8..c7d56ae8b6 100644 --- a/Libraries/LibLine/Editor.h +++ b/Libraries/LibLine/Editor.h @@ -46,6 +46,7 @@ #include <LibLine/SuggestionDisplay.h> #include <LibLine/SuggestionManager.h> #include <LibLine/VT.h> +#include <sys/ioctl.h> #include <sys/stat.h> #include <termios.h> @@ -161,6 +162,11 @@ public: const struct termios& termios() const { return m_termios; } const struct termios& default_termios() const { return m_default_termios; } + struct winsize terminal_size() const + { + winsize ws { (u16)m_num_lines, (u16)m_num_columns, 0, 0 }; + return ws; + } void finish() { |