summaryrefslogtreecommitdiff
path: root/DevTools
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-11-10 11:47:51 +0100
committerAndreas Kling <kling@serenityos.org>2020-11-10 11:55:18 +0100
commit07a2d22c3368d153f8e1afb8ce30646c7660f56d (patch)
tree86ab9cdd268877156c642428214b1e9bd5007e2a /DevTools
parent9475427d5def387dc56d6d70c729aaaf0a31fa34 (diff)
downloadserenity-07a2d22c3368d153f8e1afb8ce30646c7660f56d.zip
HackStudio: Scroll embedded terminals to bottom upon command execution
It was kinda annoying that you had to scroll down manually every time you started a new build while looking at some error in the scrollback.
Diffstat (limited to 'DevTools')
-rw-r--r--DevTools/HackStudio/HackStudioWidget.cpp6
-rw-r--r--DevTools/HackStudio/TerminalWrapper.cpp3
-rw-r--r--DevTools/HackStudio/TerminalWrapper.h2
3 files changed, 7 insertions, 4 deletions
diff --git a/DevTools/HackStudio/HackStudioWidget.cpp b/DevTools/HackStudio/HackStudioWidget.cpp
index c0f5eb9b0e..2ecf6f808e 100644
--- a/DevTools/HackStudio/HackStudioWidget.cpp
+++ b/DevTools/HackStudio/HackStudioWidget.cpp
@@ -505,10 +505,10 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_add_terminal_action()
return GUI::Action::create("Add new Terminal", { Mod_Ctrl | Mod_Alt, Key_T },
Gfx::Bitmap::load_from_file("/res/icons/16x16/app-terminal.png"),
[this](auto&) {
- auto& terminal = m_action_tab_widget->add_tab<TerminalWrapper>("Terminal");
- reveal_action_tab(terminal);
+ auto& terminal_wrapper = m_action_tab_widget->add_tab<TerminalWrapper>("Terminal");
+ reveal_action_tab(terminal_wrapper);
update_actions();
- terminal.terminal()->set_focus(true);
+ terminal_wrapper.terminal().set_focus(true);
});
}
diff --git a/DevTools/HackStudio/TerminalWrapper.cpp b/DevTools/HackStudio/TerminalWrapper.cpp
index 9b485b6906..f3c12ee6fa 100644
--- a/DevTools/HackStudio/TerminalWrapper.cpp
+++ b/DevTools/HackStudio/TerminalWrapper.cpp
@@ -154,6 +154,9 @@ void TerminalWrapper::run_command(const String& command)
}
ASSERT_NOT_REACHED();
}
+
+ // (In parent process)
+ terminal().scroll_to_bottom();
}
void TerminalWrapper::kill_running_command()
diff --git a/DevTools/HackStudio/TerminalWrapper.h b/DevTools/HackStudio/TerminalWrapper.h
index f7841f4bc5..9b5a8ed0a3 100644
--- a/DevTools/HackStudio/TerminalWrapper.h
+++ b/DevTools/HackStudio/TerminalWrapper.h
@@ -41,7 +41,7 @@ public:
void kill_running_command();
bool user_spawned() const { return m_user_spawned; }
- TerminalWidget* terminal() { return m_terminal_widget; }
+ TerminalWidget& terminal() { return *m_terminal_widget; }
Function<void()> on_command_exit;