summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibVT/TerminalWidget.cpp7
-rw-r--r--Libraries/LibVT/TerminalWidget.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/Libraries/LibVT/TerminalWidget.cpp b/Libraries/LibVT/TerminalWidget.cpp
index 948c2f402c..ae8a42062c 100644
--- a/Libraries/LibVT/TerminalWidget.cpp
+++ b/Libraries/LibVT/TerminalWidget.cpp
@@ -243,7 +243,7 @@ void TerminalWidget::keydown_event(GUI::KeyEvent& event)
m_terminal.handle_key_press(event.key(), event.code_point(), event.modifiers());
if (event.key() != Key_Control && event.key() != Key_Alt && event.key() != Key_LeftShift && event.key() != Key_RightShift && event.key() != Key_Logo)
- m_scrollbar->set_value(m_scrollbar->max());
+ scroll_to_bottom();
}
void TerminalWidget::keyup_event(GUI::KeyEvent& event)
@@ -885,3 +885,8 @@ void TerminalWidget::clear_including_history()
{
m_terminal.clear_including_history();
}
+
+void TerminalWidget::scroll_to_bottom()
+{
+ m_scrollbar->set_value(m_scrollbar->max());
+}
diff --git a/Libraries/LibVT/TerminalWidget.h b/Libraries/LibVT/TerminalWidget.h
index 3f83c50229..3d6ce15f6e 100644
--- a/Libraries/LibVT/TerminalWidget.h
+++ b/Libraries/LibVT/TerminalWidget.h
@@ -73,6 +73,8 @@ public:
VT::Position normalized_selection_start() const;
VT::Position normalized_selection_end() const;
+ void scroll_to_bottom();
+
bool is_scrollable() const;
int scroll_length() const;
void set_scroll_length(int);