mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:27:34 +00:00
Add basic PTY support.
For now, there are four hard-coded PTYs: /dev/pt{m,s}[0123] Use this in the Terminal to open a pty pair and spawn a shell.
This commit is contained in:
parent
ecb4ab0943
commit
2f74c2f430
21 changed files with 287 additions and 10 deletions
24
Kernel/SlavePTY.h
Normal file
24
Kernel/SlavePTY.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
#include "TTY.h"
|
||||
|
||||
class MasterPTY;
|
||||
|
||||
class SlavePTY final : public TTY {
|
||||
public:
|
||||
explicit SlavePTY(unsigned index);
|
||||
virtual ~SlavePTY() override;
|
||||
void set_master(MasterPTY& master) { m_master = &master; }
|
||||
|
||||
virtual String tty_name() const override;
|
||||
|
||||
void on_master_write(const byte*, size_t);
|
||||
|
||||
protected:
|
||||
virtual void on_tty_write(const byte*, size_t) override;
|
||||
|
||||
private:
|
||||
unsigned m_index;
|
||||
MasterPTY* m_master { nullptr };
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue