summaryrefslogtreecommitdiff
path: root/src/tty/tty.zig
Commit message (Collapse)AuthorAge
* A mouse report before the first row or column (SGR's 0, a drag past the ↵Gabriel Schneider2 hours
| | | | | | window's top or left, in cells or 1016's pixels) is the window's edge in the terminal and the ESP32 shells, never a panic that lost unsaved text; the GUI already clamped Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Back and Forward keep to the focused file: Ctrl-o, Ctrl-i, the mouse's side ↵Gabriel Schneider9 hours
| | | | buttons (now the tty's 8 and 9 too), the builtins and 9P go to the nearest place that way in this pane, else in this file in another pane, else of any file; JumpScope all takes every place in order as before
* A terminal pane draws the kitty graphics its program places, so yazi's image ↵Gabriel Schneider26 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and PDF previews show yazi asks the pane XTVERSION, and ghostty-vt answers "libghostty": yazi takes it for Ghostty and sends its previews by the kitty graphics protocol with Unicode placeholders (a=T,U=1, then U+10EEEE cells). ghostty-vt stored the images, but nothing drew them: the placeholders showed as tofu in the GUI and as raw codepoints in the tty, in every build since terminal panes answered queries (vkznsvzs, 2026-07-01). Before that no query was answered and yazi fell back to chafa's text art. Each frame, TerminalImages.zig reads the active screen's images and placements (virtual ones through their placeholder runs, and ones placed on a cell), cuts each into the cell rows it covers, maps those rows through the body's own row walk, clips them to the pane, and hands them on as ImagePlaces with exact geometry (NativePlacement.exact). The GUI draws them as textures; the tty passes them to an outer terminal with kitty graphics as one placement per row, its source cropped to whole cells. Placeholder cells draw no text. Scrolling, a delete, a resize, the alternate screen and a closed pane all fall out of reading the emulator's state every frame. A pane now knows its size in pixels: CSI 14/16/18 t are answered, the emulator's width_px/height_px follow the shell's cells, and the pty's winsize carries pixels (host_io.ptyWinsize), so yazi and a nested pardes size their images right. ghostty-vt's image store is 64 MiB per screen (its library default, 10 MB, refused a large preview), PNG transmissions are decoded with stb_image, and RGB images are converted only while shown. test/yazi_preview.py runs yazi in a hidden window on a PNG and a PDF and checks the captures, also through a tty pardes nested in the pane. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* An editor's private pardes-osc133 prompt files go at Exit and at a fatal ↵Gabriel Schneider27 hours
| | | | | | | | | | | | | | | signal, and a start sweeps the ones a dead editor left /tmp had gathered thousands of private prompt files: Exit removed its own, but an editor killed by a signal, or a crashed one, left them for ever. They now carry their editor's pid in the name, a SIGTERM or SIGHUP removes them before the signal's death, and each start removes those whose pid kill(pid, 0) answers ESRCH for. Files of the older shape carry no pid and are left alone, as a running older editor may still read them; the shared ones in the runtime directory are kept, being every session's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* An editor killed with SIGTERM or SIGHUP removes its 9P socket, and a start ↵Gabriel Schneider27 hours
| | | | | | | | | | | | | | | sweeps the pardes-9p-<pid>.sock files whose pid is gone The runtime directory had gathered a hundred sockets of dead editors: only a clean exit removed its own, and a signal or a crash left it. The terminal's kill handler and, where nothing else handles the signals, a handler of the listener's own now unlink the socket before the signal's death. At listen, each pardes-9p-<pid>.sock whose pid kill(pid, 0) answers ESRCH for, that is a socket of this user's and that nothing answers on, is removed; a live pid's, a named session's and anything else are never touched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Release Pardes 0.9Gabriel Schneider27 hours
|\ | | | | | | Co-Authored-By: Claude Opus 5.5 <[email protected]>
| * The window's F1-F24, Insert, Print Screen, Scroll Lock, Pause and Menu keys ↵Gabriel Schneider27 hours
| | | | | | | | | | | | | | | | | | | | reach a terminal's program, which they never did; every key a program gets follows its cursor keys' mode and kitty keyboard flags, pinned for both shells The keys went through ghostty's encoder already (DECCKM, the kitty flags); the GUI's native key map simply dropped the function and editing keys it did not name. Co-Authored-By: Claude Opus 5.5 <[email protected]>
| * A program that asked for focus reports (1004) hears CSI I when its pane ↵Gabriel Schneider27 hours
| | | | | | | | | | | | | | | | | | | | | | takes the keyboard and CSI O when it gives it up, to another pane, a tag or another window The core has a window-focus event now, from SDL's window focus and from the tty's own focus reports (vaxis turns 1004 on outside); the detached wire carries it: version 10. The test shell's ESC]777;mouse;focus;<1|0> fakes the window's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
| * A mouse event carries Shift and Alt as well as Ctrl, from SDL and from the ↵Gabriel Schneider27 hours
| | | | | | | | | | | | | | | | | | | | | | tty's input; a program's wheel report carries them as xterm counts them, and Shift keeps the wheel pardes's own scroll The reports are ghostty's encoder now (shift+4, meta+8, ctrl+16), with the mode and format ghostty tracks. The detached wire carries the two new bits: version 9. The test shell's ESC]777;mouse takes an optional fifth field of modifiers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* | A tty editor killed with SIGTERM or SIGHUP puts its terminal back before it diesGabriel Schneider27 hours
|/ | | | | | | | | | | | | | A nested pardes killed in a pane died with the default action. That left the pane's terminal on the alternate screen, in raw mode, with mouse and paste reporting on, so the shell under it was unusable until a reset. The tty frontend now handles both signals: it writes the resets a clean exit writes (keyboard protocol, mouse modes, focus, bracketed paste, SGR, cursor, main screen) and restores the cooked termios, all async-signal-safe. Then it dies of the same signal, since SA_RESETHAND put the default back. fs.py kills a tty session with each signal and checks for the main-screen switch and cooked mode; it fails without the handler. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* The hosts' Save, Dump and DumpThemes writes and their shell reaper are ↵Gabriel Schneider27 hours
| | | | | | | | host_io's, once, where the tty, the gui and the detached session each had a copy writeFile, writeDump and dumpThemes were byte-for-byte the same in tty.zig, gui.zig and detached/server.zig but for how each reaches its core, and the gui's and the session's reapers the same but for a pid <= 0 against == 0 (a pid is never negative there). Each vtable entry is now a line calling host_io's. ttyTaken, fgName, killJob and ptyResize stay each shell's: they are already one call to host_io each, and what differs is how a shell reaches its pty (an optional with a file, an optional with an fd, a bounds-checked array). macos.zig keeps its copies (no macOS build here to check it). No behaviour changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* F1-F25, Insert and the keypad reach a GUI's terminal panes: one vaxis key ↵Gabriel Schneider27 hours
| | | | | | | | map, vaxis_input.zig, for the tty, the gui and the board The vaxis-to-Event key mapping was copied in tty.zig, gui.zig and esp32p4.zig, and the copies had drifted: the gui's (its stdin feed, which test windows and a gui started in a terminal read) had 9 arms against the tty's 26, without the function keys, Insert or the keypad, so they reached a terminal pane as private-use codepoints. vaxis_input.zig holds effCp, mapKey and keyEvent once; the gui posts through postKey, and a test runs F5, Insert and the keypad's Up through it into a terminal pane. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Terminal.zig is terminal.zig: a file of functions and no fields takes a ↵Gabriel Schneider27 hours
| | | | | | | | namespace's lowercase name The last of the deferred renames, now that the tty and theme agents have landed: panes.terminal at its importers, the alias lines in Text.zig and File.zig and panes.zig's own uses following. dump.zig's Terminal struct, a dump record, is not this. The served sources list and docs/design.typ name the new file. test/perf.zig's references change, so the three perf baselines take its new harness id with their numbers as recorded. No behaviour changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Over a slow link the tty keeps one frame in flight: it asks the terminal to ↵Gabriel Schneider27 hours
| | | | answer after each, and draws the latest state when it does
* A blank whose ink alone changed is skipped in vaxis's own frame diff, not ↵Gabriel Schneider27 hours
| | | | weighed up per cell in the tty
* The terminal's capabilities are taken up when its answer comes, not at the ↵Gabriel Schneider27 hours
| | | | first key after it
* Faded ink on blank cells is not sent to the terminal: a focus change sent ↵Gabriel Schneider27 hours
| | | | every blank of the other panes again
* A lone ESC read by itself is the Escape key at once, not after a 50 ms waitGabriel Schneider27 hours
|
* Function keys, Insert and the keypad reach a terminal pane as their terminal ↵Gabriel Schneider27 hours
| | | | sequences
* A modifier or function key alone types nothing into a terminal paneGabriel Schneider27 hours
|
* A lone ESC that ends a read waits for the rest of its sequenceGabriel Schneider27 hours
|
* Terminal replies and malformed escape sequences never become typed textGabriel Schneider27 hours
|
* A pty/ctl exec that cannot start its shell keeps the one runningGabriel Schneider27 hours
| | | | | | Each host closed the running shell before it forked the new one, so an exec whose shell failed left the pane with none and later runs answered error shell gone. A shell not there is now refused up front, and every host starts the new shell first, replacing the old only once the close-on-exec pipe says it ran; a failure there is only said (restartFailed). Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Merge: 9P rounds 18-20 + Recent + renames + render G11-G14, tty track, ↵Gabriel Schneider27 hours
|\ | | | | | | cursor + faithful themes
| * Shader files compile again on save; an attached GUI runs the session's post ↵Gabriel Schneider27 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | chain shader_build.zig takes the Shadertoy compile out of the GUI's Post: the process that holds the core compiles each chain file behind the prefix on a thread, watches its directory (file_watch's new shader slots), and on a change reads and hashes each file, compiling only one whose bytes moved. A failed compile keeps the last good SPIR-V and is said once; the same bytes are never compiled or reported twice. A file is read with std, not fs.zig's readFile, whose turn hand-off a worker thread does not hold. A detached session compiles for its frontends and sends them the chain (wire post: each pass's scene and level or the file's SPIR-V, and ShaderAnimation) on attach and on every change, so an attached GUI runs the same passes, levels and animation as a local one while still reading no disk and running no program. The attached GUI describes its frames to the chain from the session's chrome and redraws an animating chain on its own.
| * T7: the scroll thumb flashes as a terminal pane scrollsGabriel Schneider27 hours
| | | | | | | | | | | | | | ThumbFlash (off by default) brightens a body's scroll thumb toward the ink when its view moves and fades it back over 250 ms, truecolor only. The tty present path now clears shell_continuous once before its effects and each effect only raises it, so the trail and the flash no longer mask each other.
| * T1: ChipShadow, a terminal's notice chips cast a cell's shadowGabriel Schneider27 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | ChipShadow on|off (off; the tty shell's, §9.2 T1): each notice chip casts a shadow one cell right and one down inside its own pane's body: on a blank cell a half block (▌ right, ▀ below, ▘ at the corner) in a colour 35% darker than the ground (OKLab), so the shadow is half a cell thick; under text the ground itself darkened. Never the cursor's cell, a selection, a tag or another chip; truecolor terminals only. Tests: the shadow lies right of or below the chip, never in it; nothing with it off or without truecolor. Snapshots unchanged. Feel review: .scratch/render/tty/shadow/.
| * T2: JumpTrail, a terminal cursor's jump leaves a short fading trailGabriel Schneider27 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | JumpTrail on|off (off; the tty shell's, §9.2 T2): a jump of three cells or more leaves three to five cells of trail behind the cursor along its path, their ground mixed toward the text's colour in OKLab (most beside the cursor), fading out over 120 ms. Truecolor terminals only (vaxis's answer, or COLORTERM truecolor/24bit); never the cursor's own cell, a selection or anything outside the focused pane's body; none under Motion off. It rides the continuous path (Pardes.shell_continuous) while it lasts; a few cells of output a frame. docs/effects.md opens the terminal track with the audit under decision 2 (keep and polish, remove nothing). Tests: a ten-cell jump lights 3 to 5 cells behind the cursor on its row, gone by 120 ms; a one-cell step and a terminal without truecolor light none. Feel review: .scratch/render/tty/trail/ (a real tty session replayed through pyte at 60 fps).
* | A shell given a directory is not taken to be in this process's before it has ↵Gabriel Schneider27 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | spoken, so it logs no rename to the session's and back Each host read /proc/<pid>/cwd right after forking the shell and at every frame after; before the shell's chdir that says this process's directory, a rename to it, then the real one a frame later, a rename back. A shell given a directory is named by it already (newShell) and is no longer asked at fork; and until it has printed anything, an answer naming this process's directory is not taken. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* | Tty in a missing directory fails and makes no pane; a shell that never ↵Gabriel Schneider27 hours
|/ | | | | | | | | | | | | started answers runs The host could not start the shell (its chdir failed), and the pane stayed with no pty: a run written to it waited for a prompt for ever. Tty now refuses a directory that is not there, `Tty: <dir>: no such directory`, before making a pane; and a terminal whose shell the host could not start (Pardes.shellFailed, from each host's spawn) answers any run with `error shell gone`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* pty/run's busy names the program holding the terminalGabriel Schneider27 hours
| | | | | | | | | busy said only that something ran. Where the host can tell (Linux, the tty's foreground group's /proc comm, a new fg_name host call), it says busy: <program> is running; elsewhere, busy as before. The GUI's host gains the one small callback (render agent's file: gui.zig, fgName). Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A failed Dump or a Restore of no dump fails its write, before any warningGabriel Schneider27 hours
| | | | | | | | | | | | A Dump into a DumpDir it could not write, or a Restore of a file that is not a dump, answered a ctl write with rc 0 and only a message, and the Restore warned about unsaved panes before it ever looked at the file. The hosts' dump write now fails the waiting 9P write with EIO (the late failure a Save uses), naming the path and the reason in the log, and Restore parses the file before its unsaved-panes refusal, failing with `not a pardes dump`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Kill stops a command pane's whole line again, now it runs with job controlGabriel Schneider27 hours
| | | | | | | | | | | | With the line run under job control (the change before), the job running has a group of its own, and Kill's SIGTERM to the tty's foreground group stopped only that job: of `sleep 30; touch x` the touch still ran. For a command pane the hosts now signal the shell's group as well, so the whole line stops, as it did; a line typed at a prompt still loses only its foreground job. The test forks a real pty for both halves: a background job outliving its command and the pty's hangup, and a killed line not running on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A shell that exits under a run answers exit N, and the log says exit before delGabriel Schneider27 hours
| | | | | | | | | | | | A dogfood agent ran `exit 3` through pty/run: the reader got ENOENT, and the log went straight to del. The hosts now read a shell's exit status at its pty's end as they do a command's; a run waiting on the line answers `exit 3` with what it printed, the log says `exit <serial> 3` before the pane's `del`, and an open run still stats after its pane is gone (cat fstats its input). Pins cloud9 f35b7ed, whose stat of an open fid names its open. Writes to a gone pane's pty/data, held open or not, fail ENOENT. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A Save the host cannot do fails the 9P write that asked for it, and the log ↵Gabriel Schneider27 hours
| | | | | | | | names the path and why The write answered ok and the pane stayed dirty, with `save: AccessDenied` on its message row: a script saw success. The failure now says `Save <path>: <why>`, and a 9P write that waited on the save fails with EIO and that text, logged as an err record. Co-Authored-By: Claude Opus 5.5 <[email protected]>
*-. Trial merge: 9P + helix + renderGabriel Schneider27 hours
|\ \
| | * Step core animation by the shell's clock and sleep to the next wakeGabriel Schneider27 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A shell now answers Host.now, its monotonic clock in ns, and the pump advances core animation to it: one .tick per whole 16 ms frame since core time last stood still. The same animation therefore takes the same time at 60, 120 and 144 Hz, over ssh and after a slow frame (the GUI's re-armed clock ran them ~25% slow at 144 Hz; the tty's post-frame sleep drifted). nextWake() lists every core animation in one place: a frame from now while anything moves, the end of the wait while something only waits (a message lingering, the look-hover delay), null when idle. Shells sleep exactly that long, and a wait is jumped to its end in one step, so an 800 ms linger costs one frame instead of fifty. An overshoot under 1.5 ms after a step is let go: at 60 and 120 Hz every display frame takes exactly one step (a 16 ms frame against a 16.67 ms vsync would otherwise double-step every 24th). The six tick drivers are gone: tty's timer thread only times the wait, interruptibly (a newer, shorter request cuts short a sleep still timing a longer one); the GUI's AnimationClock, web's JS tick bank (pardes_tick now takes rAF's timestamp), the detached server's and the board's ticks; grid mode steps a virtual clock straight to each wake. PARDES_TEST_CLOCK, set by the snapshot harness, gives tty and the detached server the same virtual clock. Every stepped frame is drawn. The old pump never drew the last frame of a fade (a .tick asks for no frame, and the fade was over by the check), so a theme switch stopped at 9/10 of the way until the next input: theme.golden, themesel.golden and the GUI's acme-light scene move to the theme's true colours, and nothing else changes. The frozen previous grid is captured only while a panel transition is chosen, not on every idle frame.
| | * Move the frame into draw.zig and the transitions out of layout.zigGabriel Schneider27 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pure moves, no behaviour change. draw.zig holds the whole core frame in order: render, the pane, tag, header and notice painters it calls, and the character-effect composition (Pardes.render stays a declaration alias). Presentation.zig is the panel presentation state as a file struct, and animation.zig the easing curves, transition kinds, tracks and boxes, the character effects' sources and the generic displayed-value transition, all of which lived in layout.zig. layout.zig keeps only layout.
* | | A command's exit is told once its output is in, by the pty's state, not a timerGabriel Schneider27 hours
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The watcher woke the host a second time 60 ms after the exit by its own clock while the grace was counted from the reap: a host busy for 10 ms missed it, and the tag said running for ever and Kill did nothing; and under load exit 0 could land before the last output. As decided, no timer: the exit is told once it is reaped and the pty says nothing is left (poll: no POLLIN, and no POLLHUP, which means the end of file is on its way behind the output), else at that end of file, checked after each chunk of output. The tty host checks inside its step so the frame shows it. The four hosts' copies are one host_io.takeExits/commandEof, which close a told command's pty at its end of file (the fd and the GUI's reader leaked when the exit came first). A finished command pane whose pty a job it left still holds is not reused, so that job is not hung up; and the reset before a reuse is SGR 0, not DECSTR, which ghostty's stream does not implement. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* | Kill signals a command only while it runs, and only the pane it was meant forGabriel Schneider27 hours
| | | | | | | | | | | | | | | | | | | | | | A signal effect carried only a slot, so a Kill followed in the same step by the pane's closing and its slot's reuse signalled the new pane's child; and a command pane whose child had exited and been reaped kept a process group id another process could take. The effect now carries the pane's serial, checked as it is performed, and a host signals no command whose exit it has recorded; the core already sends Kill only to a command it has not been told is done. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* | A command pane's command is over when its process exits, not when its pty closesGabriel Schneider27 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A job left in the background (sleep 100 &) held the pty open, so the pane stayed running and the child a zombie until the job ended; a command that closed its terminal and ran on got its end of file at once, the host waited 100 ms for an exit, reported exit ? and hung it up. Now each command's child is watched on a thread (waitid with WNOWAIT, so its pid stays its own until the host reaps it), and the host tells the core the exit from that: after the pty's end of file, so the output before the exit is in, or 50 ms after the exit without one, a job holding the pty. The pty stays open until both, so a command that let go of its terminal is never hung up by it. All four front ends; a host that cannot start the watcher reads the exit at end of file as before. Tests: host_io's for both cases, and cmdexit.snap end to end. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* | A command line runs as its own command pane unless it is clicked at a ↵Gabriel Schneider27 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | shell's prompt A middle click, an exec write or a tag word that no builtin knows was typed into some terminal for the pane's directory, sharing whatever state that shell was in and answering nothing, so a misspelling vanished into a shell. Now only a line clicked at an interactive terminal's prompt is typed there. From anywhere else it runs as a command pane: a terminal whose child is $SHELL -c the line in the pane's directory, full emulation, which shows its output and then exit N from the host's reaping of the child, and stays. A finished command pane is the next command's for its directory, which runs below what it showed after a '% line' line (acme appends to +Errors and never clears it, util.c:213); a running one gets a second pane. Kill ends a command pane's whole process group, the log records run and exit, exec reads back the command pane's serial, and a line is at most 1 KB, read off the pane as the host forks rather than carried in every spawn effect. ttyForDir's search for a free shell is gone. The goldens of chordcut, cmdword and layout-open change where a file's exec now opens a command pane, and ttytaken is rewritten to exec from the terminal itself; docs/open-questions.md records the decision. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* | A Restore answers its writer before hanging up, and the log records dumps ↵Gabriel Schneider27 hours
|/ | | | | | | | | | | | | | | | and restores A client that wrote Restore saw its connection cut with no answer, and could not tell a Restore from a crash. The listener now lets the writer's answer out before the cut, and cuts only the old editor's connections, refusing their requests meanwhile; a client that dials during it is the new editor's and stays. Dump logs 'dump <path>' and the restored editor's log 'restore <path>'. Keeping connections across a Restore was weighed and left: the fids name the old editor's panes and opens, so it would mean carrying serials and open records into the new one, where acme's Load only adds windows. tty's Restore also closed its shells' ptys without reaping them; it retires them now. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Kill asks the host to signal at once and says when a shell has no job to signalGabriel Schneider27 hours
| | | | | | | | | | | Kill queued a signal effect for later, so the job it saw running by its marks could have ended, and another started, before the signal went; and with job control off the job shares the shell's process group, so the host skipped it and Kill reported nothing. Kill now calls the host's kill_job while it holds the turn, and when the only job is the shell's own group says 'Kill: no job to signal', which also fails a write of Kill to ctl. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A closed terminal's shell is reaped on tty and macOS, killed if it ignores ↵Gabriel Schneider27 hours
| | | | | | | | | | | | | | | the hangup tty and macOS hung the pty up and called waitpid once without waiting, so a shell still exiting, or one that ignores SIGHUP, stayed a zombie or ran on with nobody reading it; tty also never reaped a shell that exited by itself, and its spawn into an occupied slot closed the old pty without ending the shell. host_io's retireShell says hangup, waits 100 ms on a thread (macOS has no host timer to poll from), then kills and reaps. The gui's own retired list, when full, left the slot holding the old shell and refused the next spawn into that pane; it now hands that shell to retireShell instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* A terminal pane that closes takes its shell and pty with it, in every front endGabriel Schneider27 hours
| | | | | | | | | | | | | The detached server closed a pane's pty only when the shell was respawned, hit EOF or the session shut down, so rmdir, Del or Delcol on a terminal left its shell running with nobody to read it; the tty front end and macOS did the same. Retiring a terminal pane now emits a close_pty effect, which each host that runs shells answers by hanging the pty up and ending the shell (the detached server's and the GUI's existing retire-and-reap path, and a close plus SIGHUP in the tty and macOS shells). Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Give a pane's body its own Text holding the cursor, selections, mode and undoGabriel Schneider27 hours
| | | | | | | | | | | acme keeps what edits a text in its Text (dat.h:171-190) and the window holds a body and a tag of that type. The cursor, the selections, the modal state and the edit-buffer undo move off Pane into Text.zig, Pane holds them as its body, and the edit and normal-mode operations take the Text they edit. Nothing changes in behaviour; this is the step that lets the tag become a second Text. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Give the pipe its own fields in PipeGabriel Schneider27 hours
| | | | | | | | | | | | | | Not a pure move: state moves. Pardes's `pipe_seq` and `pipe_wait` become Pipe.zig's own fields `seq` and `wait`, and Pardes embeds one as `pipe: Pipe = .{}`. pipeRequest reads only the request in flight, so it now takes `pipe: *const Pipe` and the four shells call `core.pipe.pipeRequest(id)` (their Pipe imports go away again); the other pipe functions still need the panes and keep `p: *Pardes`, writing `p.pipe.seq/wait`. Field reads in dump.zig, the shells' tests and two test files follow (`core.pipe_wait` becomes `core.pipe.wait`). No behaviour change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Split the pipe's editor side out of selection_pipe.zig into Pipe.zigGabriel Schneider27 hours
| | | | | | | | | | | | | | | | Pure move, no behaviour change: the editor half of `|` that the earlier change put at the end of selection_pipe.zig (PendingPipe, pipeMarker, submitPipe, pipeRequest, pipeFailed, pipeCut, pipeOutput, pipeResponse, and the eight pipe tests with nextPipeEffect) now lives in its own Pipe.zig, so the pipe's editor state can become Pipe's own fields next. selection_pipe.zig goes back to exactly what it was before this series: the native runner and the boundary values the shells hand to their workers. The moved code names the runner's types as `selection_pipe.X` again, as it did in pardes.zig; callers change from `selection_pipe.submitPipe(p, ..)` to `Pipe.submitPipe(p, ..)` (pardes.zig and the four shells). Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Move saving and loading a whole editor out of pardes.zig into dump.zigGabriel Schneider27 hours
| | | | | | | | | | | | | | | | | | | Pure move, no behaviour change (acme keeps dump and load in rows.c): dumpState, restore, initFromDump and initDump go verbatim to the end of dump.zig, after the dump format they read and write. Inside dump.zig the moved code's `dump.` prefix drops, so `Pane` there is the dump record; the one editor pane it names is spelled `pardes.panes.Pane`, and its other `panes.X` references become `pardes.panes.X` because dump.zig's own tests use `panes` as a local name. The methods become free functions taking `p: *Pardes`: `p.dumpState()` becomes `dump.dumpState(p)`, `core.restore(bytes)` becomes `dump.restore(core, bytes)` and `Pardes.initFromDump(..)` becomes `dump.initFromDump(..)`, in pardes.zig, the shells, layout.zig, Terminal.zig, builtins.zig and the tests (38 receiver rewrites plus the initFromDump calls). The tag-tail restore helpers stay with the tag code. Co-Authored-By: Claude Opus 5.5 <[email protected]>