summaryrefslogtreecommitdiff
path: root/core/hunks.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-23 17:10:08 -0300
committerGabriel Schneider <[email protected]>2026-11-23 17:26:17 -0300
commit2f3e7717dfa61421c71475130f540f9db6f7478c (patch)
tree919808260209ff82d9f2b651e72cefe208185700 /core/hunks.zig
parentaf78ec0dcb1ed40fd64001474f46b1b03a72475b (diff)
downloadpardes-2f3e7717dfa61421c71475130f540f9db6f7478c.tar.gz
pardes-2f3e7717dfa61421c71475130f540f9db6f7478c.zip
tty input: a terminal's reply of any length is taken, up to a stated cap past which it is dropped and said on the notice line, never an end of input: dev/tui/tui.zig `readInput` carried an unended sequence in a 1024-byte buffer and returned `error.InputSequenceTooLong` once it was full, and `inputReader` then posted `.quit`: a clipboard read's answer (OSC 52) over about 759 bytes of clipboard ENDED THE SESSION (the test below on the base: `InputSequenceTooLong` at tui.zig:163; kitty and ghostty send it, a user hits it by pasting the system clipboard from a session in a terminal); now the buffer grows (doubling, from the clipboard allocator vaxis parses with) up to `max_sequence`, the base64 of the paste limit's text with its framing (5461 KiB: a clipboard the core would paste whole is taken whole), and back to 1024 bytes after; a sequence past it is dropped (a string keeps its introducer and an `x` after it, so vaxis's parser still finds its end and passes it over as no reply it knows; anything else is let go) and said once, a new `Msg.reply_dropped` that the shell turns into the session's `setMessage` (taped, as `noticeNewer`'s line is) or a client's `link.notify`: "a terminal reply past 5461 KiB dropped: a clipboard past 4096 KiB is not pasted"; the read stays linear at megabytes (a pty hands 4 KiB a read): what was carried is not searched for frame answers again (only an answer cut across the read), not copied onto itself, and a string still arriving is not parsed again until a BEL or an ESC comes; a bracketed paste past the paste limit was cut SILENTLY (the tty kept exactly the limit, so `applyPaste` never saw more and never said so): it keeps one byte more and the core cuts and says "paste cut at its limit"; tests: "a clipboard reply of 4 KB or 1 MB is taken, whole, in a pty's reads and cut inside its end, and input goes on after it" (BEL and ST ends; fails on the base), "a clipboard reply past the cap is dropped and said once, and the input after it, another reply, is taken; a DCS and a kitty graphics answer the same", "a bracketed paste past the paste limit is cut and said, and a reply dropped is said, on the notice line" (fails on the base at "paste cut"); the test reader hands a part longer than the reader's room in reads of that room, as a tty does; shell-test Debug 1159/1162 (3 skipped; base 1156/1159)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/hunks.zig')
0 files changed, 0 insertions, 0 deletions