mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
HackStudio: Remove Terminal widget when the bound shell process dies
This feature allows the terminal widget to be automatically closed when typing `exit` inside the shell.
This commit is contained in:
parent
1a739b5d6e
commit
6f29ccaa5a
Notes:
sideshowbarker
2024-07-17 17:24:42 +09:00
Author: https://github.com/LucasChollet
Commit: 6f29ccaa5a
Pull-request: https://github.com/SerenityOS/serenity/pull/12839
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
1 changed files with 5 additions and 0 deletions
|
@ -820,6 +820,11 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_add_terminal_action()
|
|||
Gfx::Bitmap::try_load_from_file("/res/icons/hackstudio/add-terminal.png").release_value_but_fixme_should_propagate_errors(),
|
||||
[this](auto&) {
|
||||
auto& terminal_wrapper = m_action_tab_widget->add_tab<TerminalWrapper>("Terminal");
|
||||
terminal_wrapper.on_command_exit = [&]() {
|
||||
deferred_invoke([this]() {
|
||||
m_action_tab_widget->remove_tab(*m_action_tab_widget->active_widget());
|
||||
});
|
||||
};
|
||||
reveal_action_tab(terminal_wrapper);
|
||||
update_actions();
|
||||
terminal_wrapper.terminal().set_focus(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue