Преглед на файлове

HackStudio: Clear embedded terminal upon opening a different project

Lennon Donaghy преди 4 години
родител
ревизия
971a5a70d1

+ 1 - 0
Userland/DevTools/HackStudio/HackStudioWidget.cpp

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

+ 5 - 0
Userland/DevTools/HackStudio/TerminalWrapper.cpp

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

+ 1 - 0
Userland/DevTools/HackStudio/TerminalWrapper.h

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