terminal: Send signals on ^C and ^\
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
apio 2023-09-18 07:21:06 +02:00
parent f8879015ee
commit 6f683c48f0
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -135,14 +135,9 @@ Result<ui::EventResult> TerminalWidget::handle_key_event(const ui::KeyEventReque
{
if (!(m_settings.c_lflag & NOFLSH)) m_line_buffer.clear();
// FIXME: Send SIGINT.
/*if (m_foreground_process_group.has_value())
{
Scheduler::for_each_in_process_group(m_foreground_process_group.value(), [](Thread* thread) {
thread->send_signal(SIGINT);
return true;
});
}*/
pid_t group = tcgetpgrp(m_pty);
TRY(os::Process::kill(-group, SIGINT));
is_special_character = true;
}
@ -150,14 +145,9 @@ Result<ui::EventResult> TerminalWidget::handle_key_event(const ui::KeyEventReque
{
if (!(m_settings.c_lflag & NOFLSH)) m_line_buffer.clear();
// FIXME: Send SIGINT.
/*if (m_foreground_process_group.has_value())
{
Scheduler::for_each_in_process_group(m_foreground_process_group.value(), [](Thread* thread) {
thread->send_signal(SIGQUIT);
return true;
});
}*/
pid_t group = tcgetpgrp(m_pty);
TRY(os::Process::kill(-group, SIGQUIT));
is_special_character = true;
}
}
@ -598,5 +588,5 @@ void TerminalWidget::put_code_point(wchar_t c)
void TerminalWidget::quit()
{
kill(m_child_pid, SIGHUP);
kill(-tcgetpgrp(m_pty), SIGHUP);
}