serenity/Kernel/TTY
Daniel Bertalan 06c835f857 Kernel: Signal EOF/EOL characters properly in TTY
I introduced a regression in #7184 where `TTY` would report 1 byte read
in canonical mode even if we had no more characters left. This was
caused by counting the '\0' that denotes EOF into the number of
characters that were read.

The fix was simple: exclude the EOF character from the number of bytes.

This still wouldn't be correct by itself, as the EOF and EOL control
characters could change between when the data was written to the TTY and
when it is read. We fix this by signaling out-of-band whether something
is a special character. End-of-file markers have a value of zero and
have their special bits set. Any other bytes with a special flag are
treated as line endings. This is possible, as POSIX doesn't allow
special characters to be 0.

Fixes #7419
2021-05-24 00:06:06 +01:00
..
ConsoleManagement.cpp Kernel: Fix framebuffer resolution modesetting after boot 2021-05-21 08:08:33 +02:00
ConsoleManagement.h Kernel: Fix framebuffer resolution modesetting after boot 2021-05-21 08:08:33 +02:00
MasterPTY.cpp Kernel: Don't use ref_count() in MasterPTY::close() 2021-05-01 23:04:40 +02:00
MasterPTY.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
PTYMultiplexer.cpp Kernel: static vs non-static constexpr variables 2021-05-19 21:21:47 +01:00
PTYMultiplexer.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SlavePTY.cpp Kernel: Make UserOrKernelBuffer R/W helpers return KResultOr<size_t> 2021-05-13 23:28:40 +02:00
SlavePTY.h Kernel: Avoid unnecessary allocations for TTY::tty_name() 2021-05-13 08:27:42 +02:00
TTY.cpp Kernel: Signal EOF/EOL characters properly in TTY 2021-05-24 00:06:06 +01:00
TTY.h Kernel: Signal EOF/EOL characters properly in TTY 2021-05-24 00:06:06 +01:00
VirtualConsole.cpp Kernel/VirtualConsole: Fix grammar error in comment 2021-05-21 22:38:26 +01:00
VirtualConsole.h Kernel: Fix framebuffer resolution modesetting after boot 2021-05-21 08:08:33 +02:00