From 7f4249dde9216c53e39fb3233c0299bcf546b4de Mon Sep 17 00:00:00 2001 From: zach Date: Thu, 4 Jun 2026 11:16:38 +0200 Subject: [PATCH] agents --- .gitignore | 1 + AGENTS.md | 69 ------------------------------------------------------ 2 files changed, 1 insertion(+), 69 deletions(-) delete mode 100644 AGENTS.md diff --git a/.gitignore b/.gitignore index 705e2f9..c160ea1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /pkg Cargo.lock *.tar.* +AGENTS.md diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index bacf3bc..0000000 --- a/AGENTS.md +++ /dev/null @@ -1,69 +0,0 @@ -# zterm - -GPU-accelerated Wayland terminal emulator. Single Rust crate, edition 2024. - -## Build & Run - -``` -cargo run # dev build, Wayland only -cargo build --release # release -cargo test # tests -``` - -## Features - -| Feature | Effect | -|---------|--------| -| `webm` (default) | Enable WebM video via ffmpeg-next 8.x | -| `render_timing` | Enable per-frame parse/render timing instrumentation | -| `production` | `log/release_max_level_off` — zero logging overhead | - -Disable webm: `--no-default-features --features render_timing` - -## Architecture - -- **Single process**: owns PTY, terminal state, rendering. No multi-process IPC. -- **Kitty-style shared parser** (`SharedParser` in `vt_parser.rs`): 1MB ring buffer. I/O thread writes directly into it; main thread parses in-place. Lock released during parsing so I/O continues. -- **Split tree** (`SplitNode` in `main.rs`): binary tree of panes. Layout computed via recursive `layout()` pass. -- **GPU rendering** (`renderer.rs`): wgpu + WGSL shaders. Instanced rendering with sprite atlas. Per-pane GPU buffers. -- **Kitty graphics protocol** (`graphics.rs`): PNG, GIF, WebM inline images. - -## Key files - -| File | Contents | -|------|----------| -| `src/main.rs` | `App` state machine, event loop, split tree, tab/pane management, keybindings | -| `src/terminal.rs` | Terminal grid, scrollback buffer, cursor, colors, cell attributes, `Handler` impl | -| `src/vt_parser.rs` | `SharedParser` (ring buffer + I/O), `Parser` (VT escape sequence parsing), `Handler` trait | -| `src/renderer.rs` | wgpu renderer, glyph atlas, font loading, instanced rendering pipeline | -| `src/graphics.rs` | Kitty graphics protocol parser (PNG/GIF/WebM) | -| `src/config.rs` | JSON config from `~/.config/zterm/config.json`, keybinding resolver | -| `src/pty.rs` | PTY master, fork/exec child shell, SIGWINCH resize | -| `src/pipeline.rs` | wgpu pipeline builder | -| `src/keyboard.rs` | Kitty keyboard protocol, key encoding | -| `zterm.terminfo` | Custom terminfo — install with `tic -x -o ~/.terminfo zterm.terminfo` | -| `src/bin/bench_process.rs` | Benchmark binary | - -## Shaders - -WGSL files: `src/glyph_shader.wgsl`, `src/image_shader.wgsl`, `src/quad_shader.wgsl`, `src/statusline_shader.wgsl`, `src/shader.wgsl` (edge glow). - -## Config - -`~/.config/zterm/config.json` — auto-created on first run. Fields: `font_family`, `font_size`, `tab_bar_position`, `background_opacity`, `scrollback_lines`, `inactive_pane_fade_ms`, `inactive_pane_dim`, `edge_glow_intensity`, `pass_keys_to_programs`, `keybindings`. - -## Style - -- `.rustfmt.toml`: `max_width = 80` -- `.gitignore` excludes `Cargo.lock` and `/benches` (unusual for Rust) - -## Testing - -Tests live inline in source files: `vt_parser.rs`, `simd_utf8.rs`, `graphics.rs`, `vt_test_osc.rs`. Run with `cargo test`. - -## Setup - -- **Wayland compositor** required (X11 not supported) -- **FFmpeg 5.x–8.x** system libraries (for `webm` feature) -- **terminfo**: install `zterm.terminfo` so shells know the terminal type -- **Nerd Font** recommended for statusline icons (folder, branch, etc.)