1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 08:07:36 +00:00

HackStudio: Clear embedded terminal upon opening a different project

This commit is contained in:
Lennon Donaghy 2021-08-01 21:40:05 +01:00 committed by Andreas Kling
parent 6076deae1d
commit 971a5a70d1
3 changed files with 7 additions and 0 deletions

View file

@ -200,6 +200,7 @@ void HackStudioWidget::open_project(const String& root_path)
m_open_files_vector.clear(); m_open_files_vector.clear();
add_new_editor(*m_editors_splitter); add_new_editor(*m_editors_splitter);
m_todo_entries_widget->clear(); m_todo_entries_widget->clear();
m_terminal_wrapper->clear_including_history();
} }
m_project = Project::open_with_root_path(root_path); m_project = Project::open_with_root_path(root_path);
VERIFY(m_project); VERIFY(m_project);

View file

@ -152,6 +152,11 @@ void TerminalWrapper::kill_running_command()
[[maybe_unused]] auto rc = killpg(m_pid, SIGTERM); [[maybe_unused]] auto rc = killpg(m_pid, SIGTERM);
} }
void TerminalWrapper::clear_including_history()
{
m_terminal_widget->clear_including_history();
}
TerminalWrapper::TerminalWrapper(bool user_spawned) TerminalWrapper::TerminalWrapper(bool user_spawned)
: m_user_spawned(user_spawned) : m_user_spawned(user_spawned)
{ {

View file

@ -18,6 +18,7 @@ public:
void run_command(const String&); void run_command(const String&);
void kill_running_command(); void kill_running_command();
void clear_including_history();
bool user_spawned() const { return m_user_spawned; } bool user_spawned() const { return m_user_spawned; }
VT::TerminalWidget& terminal() { return *m_terminal_widget; } VT::TerminalWidget& terminal() { return *m_terminal_widget; }