summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-08-17 18:05:29 +0430
committerAndreas Kling <kling@serenityos.org>2020-08-17 17:44:02 +0200
commitc96b9fdb0a1962d67cde66842d7ab2a70f374e82 (patch)
tree5c79976a2ff79aa2251c8f3423ea84a100804b8b /Libraries
parentfbc3b8e3c8f10c744779b43e9e30d89b999a57e2 (diff)
downloadserenity-c96b9fdb0a1962d67cde66842d7ab2a70f374e82.zip
LibLine: Add a getter for num_lines/num_cols
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibLine/Editor.h6
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()
{