summaryrefslogtreecommitdiff
path: root/src/ninep/events.zig
Commit message (Collapse)AuthorAge
* An exec written back to event on a diff line (MX0 0) takes the word there, a ↵Gabriel Schneider7 hours
| | | | | | header's, a hunk header's or the marker's, never the address; only a look takes it Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Tab N sets a tab's width in cells, 1 through 16, in every pane, drawn and ↵Gabriel Schneider8 hours
| | | | | | | | | | | counted (wrapping, clicks, the cursor); bare Tab says it; the ctl read and a Dump keep it A session setting, not acme's per window: the width is read by File's pure width functions (~130 callers that are given no pane), so it is one value, config.tab_now, that Runtime.apply sets and a new session resets. A file:L:C column counts runes, as compilers do, and never depended on it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A msg record carries what was said, not the message row's clock: `msg 21 ↵Gabriel Schneider23 hours
| | | | | | | | | | dumped themes ...`, no `04:39:41 ` before it Messages a host stamps (saved, reloaded, dumped themes) went into the log with their clock and its double blank. The log has no times; noteMessage records the words after the stamp (Message.body). Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A log follower hears every record queued before a Restore: the read it holds ↵Gabriel Schneider25 hours
| | | | | | | | | | | | takes all that fit, before the hangup cuts it A follower reads one record per read, and a Restore hangs every client up, so records queued just before it -- the ones a script most wants, what led up to the Restore -- were lost: the read after the first was cut. Before the cut, each held read of /log is answered with every whole record queued that fits it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* An event write-back refuses an origin not E, F, K or M, and a number past ↵Gabriel Schneider27 hours
| | | | | | | | | | | what a range holds, EINVAL with why A record from origin Q was taken as any other, and an offset past 2^32 was clamped to the largest one and acted on. Both are now refused before anything runs, the overflow as "bad number"; a range past the end was and is EINVAL too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* An event record is delivered in pieces to reads shorter than it, so a bash ↵Gabriel Schneider27 hours
| | | | | | | | | | | | | read loop on event works A read shorter than the record waiting was refused EINVAL, and bash's read, a byte at a time on a file it cannot seek in, failed on the first record. A short read now takes the record's front and the next read the rest, as log and pty/data already did and acme allows. A unit test reads two records a byte at a time; selfmount runs a bash read on event through the mount. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A ctl refusal quotes the offending word alone, everywhere: wrong #args in ↵Gabriel Schneider28 hours
| | | | | | | | | | | | control message "Newcol", not "Newcol 2" Some refusals quoted the whole line, arguments and all ("Newcol 2", "Verbose maybe", "lock x"), others the word alone ("Theme", "Mount"), so a script matching one could not match the other. Every ctl refusal, the root's, a pane's and a column's, now quotes the message's word alone, and one too long to quote whole gives up its middle. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* An event reader whose pane closes reads EOF, not ENOENTGabriel Schneider28 hours
| | | | | | | | | | A script following a pane's event in a loop ended in an error when the pane went, though nothing had gone wrong: the pane was simply done. A read on an event open whose pane has closed now answers no bytes, the end a pipe's reader sees when its writer goes, so cat and while-read end cleanly. pty/data keeps acme's answer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* /index and the log escape a control byte, DEL or C1 in a name as \xNN, as ↵Gabriel Schneider28 hours
| | | | | | | | | | | they do a byte not UTF-8, so the name decodes to what it is A control byte in a name read as a space, so /index could not be decoded back to the name the name file now accepts (\x07 and a space read the same). Every byte a name holds that is not printable UTF-8 is now \xNN there; a message's text keeps spaces. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A builtin refused when its record is written back through event fails that ↵Gabriel Schneider28 hours
| | | | | | | | | | | | write, EIO and its err, as fs.md says A Del refused over unsaved text, written back by an event reader, said so on the message row and answered the write ok, so the script that wrote it could not tell. The write-back now captures failures as an exec write does: the first one fails the write with its words and the errno they read as. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* One diff-aware expansion for a click, a 9P whole-line look and an empty ↵Gabriel Schneider28 hours
| | | | | | | | | | | | | | | event write-back; a blank context line resolves to its path:line The mouse expanded a diff line by its kind (a header or a hunk line's prefix to the line's address, a hunk line's code to words), but an empty look written back to event used the plain word expansion, so ML on a `+` took nothing, and a 9P look of a blank context line (` `) was refused as whitespace. look.diffClick is now the one answer: the mouse, the whole-line look and the event write-back all ask it, and a blank context line is a line like any other. A test asks all three on each kind of line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* log stats 0, and pardes re-pins cloud9 whose 9ns opens such a file direct ↵Gabriel Schneider28 hours
| | | | | | | | | | | | | | | | and nonseekable: fs.md's follow recipe with cat works through a mount The log stated the length an open would freeze, a length a mount's kernel could take as its end, and a splicing cat read it from the kernel's offset. log now stats 0, as the other streams and generated views do, and the re-pinned cloud9's 9ns opens any file stating 0 FOPEN_DIRECT_IO | FOPEN_NONSEEKABLE. A look at such a file (the mounted index) reads a regular file that will not seek as a stream rather than refusing it as a pipe. selfmount runs the recipe, exec 3<>log; echo follow >&3; cat <&3, through the mount and hears a record made after it started. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Recent and /recent keep PDFs and images as they keep files, and an open ↵Gabriel Schneider28 hours
| | | | | | | | | | | | file's row is where its dot is now Only text files were recorded, so a PDF read yesterday was not there to find again, and an open file's row showed the place it last closed at, stale by however far it had moved since. A PDF is kept at its page and reopened there from its row; an image by its path; an open one's row reads its pane's place at the time of the listing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Save path logs a save record naming the path it wroteGabriel Schneider28 hours
| | | | | | | | | | | Save of a pane's own file logged `save <serial> <name>`, and so did a scratch's `Save path` (the pane takes that name). A `Save path` that writes a copy of a file pane, or a terminal's scrollback, elsewhere logged nothing, so a follower could not tell the file was written. It now logs `save <serial> <path>` with the path written, once the host has written it (events.noteLogAs). fs.md's log table says so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* An empty range written back to event acts on the word a click there expands ↵Gabriel Schneider28 hours
| | | | | | | | | | | | to, as acme's expand does `ML960 960` or `MX1 1` written back with no text acted on the empty range between the offsets: a look of nothing, an exec of nothing. A click at a point expands to the word or file name under it, and acme's written-back event does the same. It now expands with look.expandedWord, as a no-drag click does, on its line of the body or tag. fs.md says so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* An event record written back without its trailing newline is taken, as every ↵Gabriel Schneider28 hours
| | | | | | | | | | | other line file's last line is `printf 'MX0 10' > event` was refused as a malformed record, while exec, look and every ctl take a last line with no newline. The event file now does too: a write not ending in a newline is read as though it did, and the write still counts the bytes that came. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Nothing about a pane is logged before its new, and the boot terminal's new ↵Gabriel Schneider28 hours
| | | | | | | | | | | | | | | carries the session directory, not / and a rename A pane named in the update that made it (Config's init file, a look renamed on open) logged `rename N <name>` before `new N`, so a follower met a serial it had never seen. The boot shell, started with no directory, was announced as `new 1 /` and renamed once its shell spoke. Now noteLog drops the rename of a pane not yet announced, since its new carries the name, and announces a pane first for any other record about it. A terminal whose shell has not said where it is is named by the session's directory, where it was started, and the shell saying so is no rename. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Column serials go on across a Restore as pane serials do: a restored column ↵Gabriel Schneider28 hours
| | | | | | | | | | | | never takes a serial the old session handed out A Restore carried next_serial over for panes but started column serials at 1 again. So a restored column could take the serial a deleted column had, and a script holding col/<n> from before the Restore would find a different column there. The column counter is now carried over like the pane one, and restoredcol maps each old serial to a fresh one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A 9P error past 128 bytes keeps its reason: the path in it gives up its ↵Gabriel Schneider28 hours
| | | | | | | | middle to … An Rerror carries 128 bytes (Plan 9's ERRMAX) and the engine cut longer text there, and a builtin's failure was first clipped between words to 256 with ...: either way the end, which says why, was what went. tree.handle now fits a long reason by cutting the middle of its longest path, else of the whole text, on a character boundary, and reportFailure fills its buffer the same way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Only a write logs an err: a refused open or truncation, create or remove, or ↵Gabriel Schneider28 hours
| | | | | | | | a write to pane/new, is its error alone, and every refusal is said in words The one-failure rule is a write's. A refused remove, pane/new's open refused for want of a slot, and an OTRUNC open's refused truncation (data's after a failed addr) also logged an err, and a reply carrying only an errno reached the client as the C library's text (Operation not permitted). tree.handle now gives such a reply Plan 9's words, chosen so 9ns maps each back to its errno (EPERM's to EACCES, as Plan 9's does), and serveFs logs errs for writes only, not a write to pane/new, which is only read. docs/fs.md and the 9P skill say so, and that a look miss quotes what was written. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A repeated log record is counted only when its whole text repeats, not just ↵Gabriel Schneider28 hours
| | | | | | | | what was cut to fit (xN) compared records after msg and err cut long texts to fit, so two different long failures that agreed in their first 200-odd bytes were counted as one. The whole text of the newest counted record is now hashed, and a repeat needs it too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A look miss said again is its err record counted, as any repeated err isGabriel Schneider28 hours
| | | | | | Look's miss pushed its err record plain, so a script retrying one look filled the log with the same line, where other errs are counted (x2). Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Recent keeps only files on disk, and its cap never drops an open oneGabriel Schneider28 hours
| | | | | | A renamed scratch never saved and a /virtual/ pane were recorded as recent files, and at 200 the oldest entry went even when that file was open. Opens, renames and closes now record a path only when it is a file on this host, and the cap drops the oldest closed entry. A name with a newline is not written to the kept list, where it would read back as two. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* The panes present at boot are the log's first records, before what an init ↵Gabriel Schneider28 hours
| | | | | | | | file said The boot announce ran after the init file, so its msg (ThemeSel: renamed to Themes) came before new 1. A msg or path record said while the log is still empty now announces the panes first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A builtin's Verbose announcement is the message row's alone, never loggedGabriel Schneider28 hours
| | | | | | With Verbose on by default, /log filled with msg - DumpDir, msg 4 Grep and the like, with machinery to take an announcement back out when its builtin failed or said something itself. A msg record is now only something said; the take-back machinery goes with it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Recent lists the files opened lately, closed ones too, and a jump back to a ↵Gabriel Schneider28 hours
| | | | | | | | | | | | | | | | closed file reopens it A file closed by accident, its path forgotten, could not be found again: the jumplist dropped closed panes. Every file opened (a look, a Save of a scratch, a Restore, a rename) goes first in a list of 200, kept once, its dot noted when it closes, kept across sessions in $XDG_STATE_HOME/pardes/ recent. `Recent` (SPC f r) shows it in a reused +Recent, each row `path:line:col open|closed` a look reopens; /recent reads `open|closed <path>`. The jumplist keeps a closed file's entries, +Jumps marks them `(closed)`, and Back to one opens the file at its place. acme has no such thing; its dump and Load are the nearest. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A bad event record says what is wrong with itGabriel Schneider28 hours
| | | | | | | | `bad event syntax` said nothing of which: now it says a report record (I D i d) is not written back, a range ends before it starts, or what a record looks like when the line is not one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A name shows its own backslash as \\, and a terminal tag never carries a raw ↵Gabriel Schneider28 hours
| | | | | | | | | | | newline With `\n` for a newline and `\xNN` for a bad byte, a name holding a backslash and an n read back as one holding a newline. Names in /index, the log and a terminal's tag now double their own backslashes; and a terminal's directory with a newline no longer breaks its tag. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* An err record's reason that names its file already is not prefixed twiceGabriel Schneider28 hours
| | | | | | | A refused look logged `err N look: look: no space for a pane...`: the reason began with the file's name, and the record put it before it again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* /index shows names as the log does, one line of UTF-8, and a newline in a ↵Gabriel Schneider28 hours
| | | | | | | | | | | | name as \n /index printed a name as it was, so a directory with a newline in it split its row in two, and bytes not UTF-8 went through; the log turned the newline into a space, silently another name. Both now show a name one way: a newline `\n`, other controls, DEL and C1 a space, bytes not UTF-8 `\xNN`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Every EINVAL a write gets says why; DEL in an exec or look line is a control ↵Gabriel Schneider28 hours
| | | | | | | | | | | | character An empty name, a word written to log other than follow, a data, sel, dot or dirty write to a pane with no text, a truncate other than to zero, and a control character in a look line written through a held open were refused with no words, logged as `Invalid argument`. Each says its reason now; and DEL is refused in exec and look lines as in names. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A name write is one name, refused with its reason otherwise; a log record is ↵Gabriel Schneider28 hours
| | | | | | | | | | | | | one line of UTF-8 A name took a second line, DEL, a C1 control or bytes that are not UTF-8, which then went into /index and /log as they were and split or garbled a reader's lines. `name` strips one trailing newline and refuses the rest, saying which (`bad character in file name: not UTF-8`); and the log turns DEL and C1 into spaces, as it did control characters, and escapes bytes that are not UTF-8 as `\xNN`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A root exec or look that fails logs its err against the pane it ran atGabriel Schneider28 hours
| | | | | | | | `err - exec: ...` said nothing of where the line ran; the root's exec and look run at the keyboard's pane, and their err now names it, as a click there would. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A refusal over unsaved panes logs each as `unsaved <serial> <name>`, and its ↵Gabriel Schneider28 hours
| | | | | | | | | | | | err never cuts a list Exit's refusal joined every name into one err, cut at the record's cap in mid-name, so a script could not tell which panes held it up. Each pane is now an `unsaved` record before the err, and the err names the one pane or counts them: `4 unsaved panes: Modified (Exit again to discard)`. Restore, Del and Delcol refuse the same way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A builtin's Verbose announcement is logged only when it succeedsGabriel Schneider28 hours
| | | | | | | | | | | A failure said while it ran (Exit's refusal, a Del refused) or later by the host (a Save's write, a Dump's) left `msg N Save` in the log as if it had worked. The announcement's record is remembered and taken back out on either, unless a follower read it already. A refused pane/new logs its err alone, and a failed Dump says its reason in words (`file not found`, not `FileNotFound`) so its msg goes and the err is the one record. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A long msg record is cut between words with an ellipsis, as an err record isGabriel Schneider28 hours
| | | | | | | A Msg past 256 bytes was cut mid-word and silently: nothing told a reader of /log that the line went on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A long err record is cut between words, with an ellipsisGabriel Schneider28 hours
| | | | | | | An err record's reason was cut at 200 bytes, mid-word. It is now cut at the last word that fits, and ends with an ellipsis. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A prompt a 9P request opens is an ask, answered with answer, never stackedGabriel Schneider28 hours
| | | | | | | | | | | Save through exec on a terminal (or a scratch) opened its path prompt on screen, where no script could see or answer it, and a second Save stacked another. Opened while a 9P request is served, it now logs ask <serial> save path; answer <path> on the pane's ctl saves there and closes it, answer - closes it; asked again, the open one stands. A pane closed with it open logs answer <serial> -. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A Save that fails logs its err, not a save recordGabriel Schneider28 hours
| | | | | | | | | The save record was logged as soon as the host was asked to write, so a Save into a read-only directory logged save and then failed. It is now logged only once the write is done; a failure's err record (the write's, naming the path) stands alone, the msg it was also said as dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A chorded record written back with its two follow-ups runs once, with its ↵Gabriel Schneider28 hours
| | | | | | | | | | | | | argument Writing a chorded exec's three records back as read ran the argument and its location as shell commands. The first record (flag 8) now takes the next record as its argument when it comes in the same write, else the one kept from the click (or, with none kept, waits for it); its two follow-up records, however they are written, are consumed as its, never run. Tested written back together and one per write. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* follow new: a log follower that starts at the endGabriel Schneider28 hours
| | | | | | | | | A follower read the ring's whole history before anything new, and there was no way to skip it. Writing follow new instead of follow skips what the open froze and waits for what comes after (tail -n0 -f); fs.md and the skill say that follow replays first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A look written back from an event sets what look reads backGabriel Schneider28 hours
| | | | | | | | A look an event reader wrote back ran, but /look still read the last look made through it. It now answers the pane the written-back look found, as a look written there would. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A chorded exec an event reader holds is told its argument, and runs with itGabriel Schneider28 hours
| | | | | | | | | | | | With event open, a 2-1 chord's exec went out as one record with flag 8 and nothing after it: the argument was freed unsaid. As acme does (exec.c:150-190), two records follow it, the argument's text and where it came from (file:#q0,#q1, empty when not known), and the pane keeps the argument, so the record written back runs with it (acme's own write-back, xfid.c:842, passes none; the reader was told, so it runs as the click would have). Co-Authored-By: Claude Opus 5.5 <[email protected]>
* An event write-back past the text says range past end of bodyGabriel Schneider28 hours
| | | | | | | | | A well-formed record whose range ran past the body (or tag) was refused as "bad event syntax", which sent a client looking for a typo. It now says "range past end of body" (or tag); a malformed one keeps the old words. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A failed builtin's err replaces its msg, and (xN) is a running totalGabriel Schneider28 hours
| | | | | | | | | | | A builtin failing a ctl write logged its Verbose announcement, its words as a msg, and the write's err, so the same failure again never repeated the newest record and never collapsed. Its err alone is logged now (the msg is still shown and kept in +Messages). A repeat of a record a follower has read is a new line with the running total, (xN) being N in all. fs.md states both rules. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A read on a closed pane's event ends ENOENT, and the pane cap is ENOSPCGabriel Schneider28 hours
| | | | | | | | | | 9ns reads an error's words, not its errno: "window shut down" came out as EIO where every other file of a gone pane gives ENOENT, and "no pane slots" as EIO. The event and pty/data reads a pane closed under now say "no such pane: its window shut" (ENOENT), and the cap says "no space for a pane: 64 max" (ENOSPC; 9ns has no word for ENFILE). Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A pane closed with its question standing logs answer <serial> -Gabriel Schneider28 hours
| | | | | | | | A follower that saw ask never heard the question end when its pane closed first. Retiring a pane with a question still up now logs answer <serial> - before its del. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A msg said again word for word is that line counted in the logGabriel Schneider28 hours
| | | | | | | | | | 1000 Undos with nothing left made 2000 log lines: the Verbose announcement and the answer each time. A msg repeating the newest record is now that record counted, (xN), as err's already were (shared as pushCounting), unless a follower has read it; and a builtin's own words that start with its name take the place of its announcement just before them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* An error on a column's ctl, exec or rmdir names that file in the logGabriel Schneider28 hours
| | | | | | | | noteError named every column node col/<serial>/tag, so a refused ctl write or rmdir pointed at the tag. It now names col/<serial>/ctl, /exec, /tag or the directory itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A column has a ctl, an exec and an rmdir over 9P, and Restore maps its serialGabriel Schneider28 hours
| | | | | | | | | | | | | | A script could read and write a column's tag but not act on the column. col/<serial>/ctl takes Delcol, Joincol, New and Tty, each acting on that column as from its tag; col/<serial>/exec runs a word as a middle click in the tag; rmdir col/<serial> closes an empty column and refuses one with panes (ENOTEMPTY, an err record saying why). The root ctl's refusal of Delcol and Joincol points at col/<serial>/ctl. A dump keeps each column's serial and Restore logs restoredcol <old> <new>; the dump golden gains them. Documented: Joincol's survivor, the column on the right, keeps its serial and tag. Co-Authored-By: Claude Opus 5.5 <[email protected]>