The Pedigree Project 0.1
TerminalControl.h
1/* Copyright (c) 2026, Pedigree Developers. */
2#ifndef POSIX_TERMINALCONTROL_H
3#define POSIX_TERMINALCONTROL_H
4
5#include "modules/system/console/Console.h"
6
7class PosixProcess;
8
9class TerminalControl final : public ConsoleControlState {
10 public:
11 TerminalControl(size_t session, size_t foreground);
12 bool active() const;
13 void controlCharacter(Character character) override;
14 static Mutex& lock();
15 static int attach(ConsoleFile& console, bool steal, bool automatic = false,
17 static int setForeground(ConsoleFile& console, int group,
18 const SharedPointer<ConsoleIoState>& opened);
19 static int foreground(ConsoleFile& console, const SharedPointer<ConsoleIoState>& opened);
20 static int hangup();
21 static void processTerminated(PosixProcess& process);
22
23 private:
24 void invalidate();
25 bool m_Active;
26 size_t m_Session;
27 size_t m_Foreground;
28};
29#endif
Definition Mutex.h:56