summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorjoshua stein <jcs@jcs.org>2020-01-15 21:13:54 -0600
committerAndreas Kling <awesomekling@gmail.com>2020-01-16 12:41:09 +0100
commit5c25983844046f50da9750e10d0ae01f40b1c5e3 (patch)
tree35cdabdfa3f10312647eb53c65622c82a35aa1dd /Libraries
parentd9385d7d6252dbd0f5882a43d4a6b328fce0daf0 (diff)
downloadserenity-5c25983844046f50da9750e10d0ae01f40b1c5e3.zip
LibVT: enforce a minimum size of 1 column and 1 row
Fixes #829
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibVT/Terminal.cpp5
-rw-r--r--Libraries/LibVT/Terminal.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/Libraries/LibVT/Terminal.cpp b/Libraries/LibVT/Terminal.cpp
index 61b72447d4..9ba80fd532 100644
--- a/Libraries/LibVT/Terminal.cpp
+++ b/Libraries/LibVT/Terminal.cpp
@@ -867,6 +867,11 @@ void Terminal::unimplemented_xterm_escape()
void Terminal::set_size(u16 columns, u16 rows)
{
+ if (!columns)
+ columns = 1;
+ if (!rows)
+ rows = 1;
+
if (columns == m_columns && rows == m_rows)
return;
diff --git a/Libraries/LibVT/Terminal.h b/Libraries/LibVT/Terminal.h
index ab1a843bb0..8f74acfa09 100644
--- a/Libraries/LibVT/Terminal.h
+++ b/Libraries/LibVT/Terminal.h
@@ -150,8 +150,8 @@ private:
int m_scroll_region_top { 0 };
int m_scroll_region_bottom { 0 };
- u16 m_columns { 0 };
- u16 m_rows { 0 };
+ u16 m_columns { 1 };
+ u16 m_rows { 1 };
u16 m_cursor_row { 0 };
u16 m_cursor_column { 0 };