mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
00c21d1590
And print a greeting when sh starts up so we know which TTY we're on.
26 lines
554 B
C++
26 lines
554 B
C++
#pragma once
|
|
|
|
#include <VirtualFileSystem/CharacterDevice.h>
|
|
|
|
class TTY : public CharacterDevice {
|
|
public:
|
|
virtual ~TTY() override;
|
|
|
|
virtual ssize_t read(byte*, size_t) override;
|
|
virtual ssize_t write(const byte*, size_t) override;
|
|
virtual bool hasDataAvailableForRead() const override;
|
|
|
|
virtual String ttyName() const = 0;
|
|
|
|
protected:
|
|
virtual bool isTTY() const final { return true; }
|
|
|
|
TTY(unsigned major, unsigned minor);
|
|
void emit(byte);
|
|
|
|
virtual void onTTYWrite(byte) = 0;
|
|
|
|
private:
|
|
Vector<byte> m_buffer;
|
|
};
|
|
|