Kernel: Barebones implementation sessions and process groups

This commit is contained in:
2023-08-22 11:35:40 +03:00
parent 642929f071
commit 0f6c19a1b7
5 changed files with 140 additions and 69 deletions

View File

@@ -29,7 +29,7 @@ namespace Kernel
static dev_t next_tty_rdev()
{
static dev_t major = DevFileSystem::get().get_next_rdev();
static dev_t minor = 1;
static dev_t minor = 0;
return makedev(major, minor++);
}
@@ -75,17 +75,17 @@ namespace Kernel
ASSERT(MUST(Process::current().sys_read(fd, &event, sizeof(event))) == sizeof(event));
TTY& current_tty = *TTY::current();
if (current_tty.m_foreground_process &&
if (current_tty.m_foreground_pgrp &&
event.pressed() &&
event.ctrl() &&
!event.shift()
&& event.key == Input::Key::C
)
{
if (auto ret = Process::sys_kill(current_tty.m_foreground_process, SIGINT); ret.is_error())
if (auto ret = Process::sys_kill(-current_tty.m_foreground_pgrp, SIGINT); ret.is_error())
dwarnln("TTY: {}", ret.error());
}
else
else
current_tty.on_key(event);
}
}, nullptr