[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78FG8VSMTVA2D3BCY7SNRAK":3,"skill-same:01M78FG8VSMTVA2D3BCY7SNRAK":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M78FG8VSMTVA2D3BCY7SNRAK","pty-vt",null,"Embedded PTY sessions and VT emulation — lifecycle, resize, scrollback bounds, teardown on panic, and why shell invocation is an injection boundary.","poppyTM\u002Foride","poppyTM","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F339400917?v=4","01M78F6YNKFR5S5JQR27X9F09Z","Poppy Team","01M78F6YP8ZZTRES9X8Q2ZAD21",1,"MIT","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fpty-vt\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: pty-vt\ndescription: Embedded PTY sessions and VT emulation — lifecycle, resize, scrollback bounds, teardown on panic, and why shell invocation is an injection boundary.\n---\n\n# PTY & VT Emulation\n\n## Purpose\n\nThe embedded terminal is a process boundary, not a widget. It owns a real child\nprocess, a file descriptor, and a screen buffer that must survive output the\neditor did not anticipate.\n\n## Session lifecycle\n\n1. Spawn once, per panel, on demand. Never on startup — an editor that always\n   starts a shell pays for it on every launch and breaks in environments without\n   one.\n2. The child is reaped. A PTY whose child was never waited on leaks a process\n   per session.\n3. Teardown is unconditional: on quit, on panic, on signal. A terminal left in\n   raw mode or alt-screen after a crash is the failure users remember.\n4. Closing the panel does not silently kill a foreground job without saying so.\n\n## Resize\n\n- The window size is propagated to the child, not just to the drawing box. A\n  program that keeps rendering 80 columns into a 40-column PTY corrupts its own\n  output.\n- Resize is coalesced: a drag produces many intermediate sizes, and each one\n  costs a SIGWINCH in the child.\n- The initial size is the real panel size, not a guess of 80×24.\n\n## Emulation\n\n- Parse into a cell buffer with attributes; never strip escape sequences and hope.\n- Alt-screen has its own buffer: the scrollback is not visible while it is\n  active, and the primary buffer must be intact when it is left.\n- Scrollback is bounded. An unbounded scrollback is an out-of-memory bug with a\n  long fuse.\n- Grapheme width is resolved at write time, so a wide character occupies the\n  cells it claims and alignment downstream is not corrupted.\n- Unknown sequences are consumed without corrupting the buffer — real programs\n  emit sequences a partial implementation has never seen.\n\n## Injection boundary\n\nThe shell command is user configuration. It is executed as a program with\narguments, never interpolated into a shell string, and never built from file\ncontents or filenames. Working directory is passed explicitly rather than by\n`cd`.\n\n## Verification\n\n- A PTY test with a real shell, gated by an environment variable so it can be\n  skipped where a shell is unavailable.\n- Feed a recorded byte stream through the emulator and compare the resulting\n  cell grid — deterministic, no timing.\n- A test asserts the terminal is restored after a panic in the draw path.\n","# PTY & VT Emulation\n\n## Purpose\n\nThe embedded terminal is a process boundary, not a widget. It owns a real child\nprocess, a file descriptor, and a screen buffer that must survive output the\neditor did not anticipate.\n\n## Session lifecycle\n\n1. Spawn once, per panel, on demand. Never on startup — an editor that always\n   starts a shell pays for it on every launch and breaks in environments without\n   one.\n2. The child is reaped. A PTY whose child was never waited on leaks a process\n   per session.\n3. Teardown is unconditional: on quit, on panic, on signal. A terminal left in\n   raw mode or alt-screen after a crash is the failure users remember.\n4. Closing the panel does not silently kill a foreground job without saying so.\n\n## Resize\n\n- The window size is propagated to the child, not just to the drawing box. A\n  program that keeps rendering 80 columns into a 40-column PTY corrupts its own\n  output.\n- Resize is coalesced: a drag produces many intermediate sizes, and each one\n  costs a SIGWINCH in the child.\n- The initial size is the real panel size, not a guess of 80×24.\n\n## Emulation\n\n- Parse into a cell buffer with attributes; never strip escape sequences and hope.\n- Alt-screen has its own buffer: the scrollback is not visible while it is\n  active, and the primary buffer must be intact when it is left.\n- Scrollback is bounded. An unbounded scrollback is an out-of-memory bug with a\n  long fuse.\n- Grapheme width is resolved at write time, so a wide character occupies the\n  cells it claims and alignment downstream is not corrupted.\n- Unknown sequences are consumed without corrupting the buffer — real programs\n  emit sequences a partial implementation has never seen.\n\n## Injection boundary\n\nThe shell command is user configuration. It is executed as a program with\narguments, never interpolated into a shell string, and never built from file\ncontents or filenames. Working directory is passed explicitly rather than by\n`cd`.\n\n## Verification\n\n- A PTY test with a real shell, gated by an environment variable so it can be\n  skipped where a shell is unavailable.\n- Feed a recorded byte stream through the emulator and compare the resulting\n  cell grid — deterministic, no timing.\n- A test asserts the terminal is restored after a panic in the draw path.\n",{"name":5,"description":7},"main","1cd515630b8ceb57777d466bee4970fe7c2e30e0",".ai\u002Fskills\u002Fpty-vt",0,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride","https:\u002F\u002Fgithub.com\u002FpoppyTM","https:\u002F\u002Fpoppy.lat","Construímos linguagens de programação e ferramentas para quem lê código com o mesmo cuidado com que escreve.","2026-09-30 10:15:52",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add poppyTM\u002Foride --skill pty-vt",{"tool":39,"command":40},"bunx","bunx skills add poppyTM\u002Foride --skill pty-vt",{"tool":42,"command":43},"pnpm","pnpm dlx skills add poppyTM\u002Foride --skill pty-vt","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fpty-vt\u002FSKILL.md",true,[],[48,54,60,67,74,81],{"skillNo":49,"name":50,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M78FHQN254KEH0DETXT5JM29","zoom-reflow","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fzoom-reflow\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M78FHP1880S695V8GQEE0RXK","wireframe-styleguide","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwireframe-styleguide\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M78FHHYM6AN2H819FABW01DZ","visual-regression","Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fvisual-regression\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M78FHE53D8DD0QVRY5C37DA4","ui-implementation","Component-driven UI implementation, multi-state matrix (default, hover, focus-visible, active, disabled, loading, empty, error), DTCG design tokens, responsive layout contracts, and accessibility tree mapping.","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fui-implementation\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M78FHBJ1KXFF734GFE509TBJ","tui-editor-engine","Text buffer and editing semantics for a terminal code editor — index conversion, transaction-first editing, multi-cursor invariants, undo grouping, and large-file behaviour.","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftui-editor-engine\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M78FH9X6CPJX1H61ZDWTTVW8","tree-sitter-context-indexing","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[]]