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

LibVT+Terminal: Give TerminalWidget a hook for EOF on the pty

Instead of quitting the application immediately when the pty gives an
EOF, fire an on_command_exit hook so the TerminalWidget client can
decide for himself what to do.
This commit is contained in:
Andreas Kling 2019-10-22 21:57:53 +02:00
parent a6b153abf1
commit cd1eee6604
3 changed files with 52 additions and 23 deletions

View file

@ -163,6 +163,9 @@ int main(int argc, char** argv)
RefPtr<CConfigFile> config = CConfigFile::get_for_app("Terminal");
auto terminal = TerminalWidget::construct(ptm_fd, true, config);
terminal->on_command_exit = [&] {
app.quit(0);
};
terminal->on_title_change = [&](auto& title) {
window->set_title(title);
};