Skip to content

Commit

Permalink
LibVT: enforce a minimum size of 1 column and 1 row
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs authored and awesomekling committed Jan 16, 2020
1 parent d9385d7 commit 5c25983
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Libraries/LibVT/Terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions Libraries/LibVT/Terminal.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ class Terminal {
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 };
Expand Down

0 comments on commit 5c25983

Please sign in to comment.