{"_id":"zigpty","_rev":"15-a6507894d5e3b6febeb1be74330d8135","name":"zigpty","dist-tags":{"latest":"0.2.1"},"versions":{"0.0.0":{"name":"zigpty","version":"0.0.0","_id":"zigpty@0.0.0","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"dist":{"shasum":"8fbd3d6d261f7be79fe85eab90e2dba3efd9cd1d","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.0.0.tgz","fileCount":1,"integrity":"sha512-jNPzHbdB1XsNpe8YtweRK+U/N1Y+6OBOX5Cw+1nrnped4PYMHnOe+1YTw2VkyVW9OxyM9L8Ly4FNAheg3P2i1g==","signatures":[{"sig":"MEQCIA7KuHm7fiTcDfGGtLwPlh7YvJPrK5p6m7oIbStmKtT5AiBSO9AgexRCM0TRt6/V2/cumE/N2CAD2v2sQxPGlr8ILg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"_npmVersion":"11.6.2","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.0.0_1774122866755_0.9379691408364808","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"zigpty","version":"0.0.2","_id":"zigpty@0.0.2","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/pithings/zigpty#readme","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"dist":{"shasum":"bddce12c409642d8f6c5d117e6ee3c8e719f0fd0","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.0.2.tgz","fileCount":11,"integrity":"sha512-2c9XmyoVea+VFNtpzCc6On9N2Fdf9bArofzvwUZylpVHeuNbbRKn+/jV5OnCYGdCTLrba93MSK0mYkpSM4psEw==","signatures":[{"sig":"MEQCIHg5TeAWsxAEM8L4HyZZhIFZQ7+VAifkSuzbgSmgV4YcAiAJpfpSvCGwQ28yenpmRUaWp+NRlGC5DfPPShVuVV+/Ig==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":175924},"type":"module","exports":{".":"./dist/index.mjs"},"gitHead":"fc78d65bd635932cabb1e3f69f511a6f0e609c7c","scripts":{"fmt":"oxfmt . && zig fmt zig/","test":"vitest run","build":"zig build --release && obuild","release":"bun run build && changelogen --release --push --publish","build:zig":"zig build --release","fmt:check":"oxfmt --check . && zig fmt --check zig/","build:zig:debug":"zig build"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"repository":{"url":"git+https://github.com/pithings/zigpty.git","type":"git"},"_npmVersion":"11.6.1","description":"Lightweight PTY library built with Zig. Usable as a **Zig package** or as a **Node.js native addon** (via NAPI).","directories":{},"_nodeVersion":"24.10.0","_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.41.0","obuild":"^0.4.32","vitest":"^3.1.4","@types/node":"^25.5.0","changelogen":"^0.6.2"},"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.0.2_1774128074332_0.193766493552733","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"zigpty","version":"0.0.3","_id":"zigpty@0.0.3","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/pithings/zigpty#readme","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"dist":{"shasum":"830f2ab9b443e46dcc77fd90657a830f1cbfe6ff","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.0.3.tgz","fileCount":13,"integrity":"sha512-hXha0JbBVxqiiGxzXh9dVwpT9j+gtUEQUAsESdB20P8wTYEQyXe5SEfopUtr7NqyDzHFIaXt0Wgzx0G7nhdFog==","signatures":[{"sig":"MEQCIA/ZJm30HhSKfyx0qvLdlCfEJyVo2ZFY6oXs10TCjJkuAiAiIW1wR1anvelBlHYUg90++U+CfbhZ4e7vr/GW63reoQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":234540},"type":"module","exports":{".":"./dist/index.mjs"},"gitHead":"8b5f7ab8c471fc221897c15c55732e9b5866d261","scripts":{"fmt":"oxfmt . && zig fmt zig/","test":"vitest run","build":"zig build --release && obuild","release":"bun run build && changelogen --release --push --publish","build:zig":"zig build --release","fmt:check":"oxfmt --check . && zig fmt --check zig/","build:zig:debug":"zig build"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"repository":{"url":"git+https://github.com/pithings/zigpty.git","type":"git"},"_npmVersion":"11.6.2","description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, and Windows (via ConPTY).","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"packageManager":"bun@1.3.10","devDependencies":{"oxfmt":"^0.41.0","obuild":"^0.4.32","vitest":"^3.1.4","typescript":"^5.9.3","@types/node":"^25.5.0","changelogen":"^0.6.2","@vitest/coverage-v8":"3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.0.3_1774178074832_0.6789994574988114","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"zigpty","version":"0.0.4","_id":"zigpty@0.0.4","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/pithings/zigpty#readme","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"dist":{"shasum":"f061663c253f713f156388a563e10b99a28cfe71","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.0.4.tgz","fileCount":13,"integrity":"sha512-VUwO/efBwbbB+El5PRRR4ewNXCa9zKKAcdj2YOur6Il3FIsLffgtAQliSbSliEoQAvt73EwWZt3FRUDPDNVRTA==","signatures":[{"sig":"MEYCIQD/aaDHcoJoIRgFJMv6aHUrlFPQ+rLpFIa0fNKQ12eN5QIhAIDpeTr455Lc0FZPZa2dZMyTZRQF5G97OK8tfR4Cm7VF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":234868},"type":"module","exports":{".":"./dist/index.mjs"},"gitHead":"017b019aa90d347e4e787a5a401a53cb163335e7","scripts":{"fmt":"oxfmt . && zig fmt zig/","test":"zig build test && vitest run","build":"zig build --release && obuild","release":"bun run build && changelogen --release --push --publish","test:bun":"zig build test && bun test","build:zig":"zig build --release","fmt:check":"oxfmt --check . && zig fmt --check zig/","build:zig:debug":"zig build"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"repository":{"url":"git+https://github.com/pithings/zigpty.git","type":"git"},"_npmVersion":"11.6.2","description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, and Windows (via ConPTY).","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"packageManager":"bun@1.3.10","devDependencies":{"oxfmt":"^0.41.0","obuild":"^0.4.32","vitest":"^3.1.4","@types/bun":"^1.3.11","typescript":"^5.9.3","@types/node":"^25.5.0","changelogen":"^0.6.2"},"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.0.4_1774188660336_0.968313874572637","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"zigpty","version":"0.0.6","_id":"zigpty@0.0.6","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/pithings/zigpty#readme","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"dist":{"shasum":"21f9e5aeb6f167f58182f9a12e895f2749b1c02e","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.0.6.tgz","fileCount":13,"integrity":"sha512-WpBZRWdQQ1a5eqzNGessw+pQ94kBWxlkRjS6WUtpITWxWhqA6c90KeKjEuVjBivXeQnMVkjV11RfbVU4lCaItw==","signatures":[{"sig":"MEUCIQCbTrSEKodWnLY11toX5sKi8j5fQv/JKrXfJv+joP/CggIgEwdcpceDA5MYM8VGFFlkLFM5jjNXlKXUqMLRRMVmD2o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":236034},"type":"module","exports":{".":"./dist/index.mjs"},"gitHead":"7b94b58f10925871725012678825ce9fc1a079e8","scripts":{"fmt":"oxfmt . && zig fmt zig/","test":"zig build test && vitest run","build":"zig build --release && obuild","release":"bun run build && changelogen --release --push --publish","test:bun":"zig build test && bun test","build:zig":"zig build --release","fmt:check":"oxfmt --check . && zig fmt --check zig/","build:zig:debug":"zig build"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"repository":{"url":"git+https://github.com/pithings/zigpty.git","type":"git"},"_npmVersion":"11.6.2","description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, and Windows (via ConPTY).","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"packageManager":"bun@1.3.10","devDependencies":{"oxfmt":"^0.41.0","obuild":"^0.4.32","vitest":"^3.1.4","@types/bun":"^1.3.11","typescript":"^5.9.3","@types/node":"^25.5.0","changelogen":"^0.6.2"},"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.0.6_1775641062471_0.5881404449246534","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"zigpty","version":"0.0.7","_id":"zigpty@0.0.7","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/pithings/zigpty#readme","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"dist":{"shasum":"d270d8ab27f99595481fc67380ca512245a922c1","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.0.7.tgz","fileCount":13,"integrity":"sha512-iprux4ToZoxqJp3qc48kDnWjJJqBxjehZmajCv//RlFwhxOoxmIBwNAX9UbLixs4pbHstpG5SFCsL2c4Pf2Ebg==","signatures":[{"sig":"MEQCIFStqI3bEPNhKPcCz/OfQ8Yq6FX3ls2vZqKpHKfXI5ayAiAFxS28Gmu51Y1h9NsxEXuGqJoPoY4lBiwyomMupTQHrA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":247510},"type":"module","exports":{".":"./dist/index.mjs"},"gitHead":"017af6cf6f7c8f2e55827638f5ff00904ba0d045","scripts":{"fmt":"oxfmt . && zig fmt zig/","test":"zig build test && vitest run","build":"zig build --release && obuild","release":"bun run build && changelogen --release --push --publish","test:bun":"zig build test && bun test","build:zig":"zig build --release","fmt:check":"oxfmt --check . && zig fmt --check zig/","build:zig:debug":"zig build"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"repository":{"url":"git+https://github.com/pithings/zigpty.git","type":"git"},"_npmVersion":"11.6.2","description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, and Windows (via ConPTY).","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"packageManager":"bun@1.3.11","devDependencies":{"oxfmt":"^0.44.0","obuild":"^0.4.33","vitest":"^4.1.3","@types/bun":"^1.3.11","typescript":"^6.0.2","@types/node":"^25.5.2","changelogen":"^0.6.2"},"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.0.7_1775663540598_0.6057539503422154","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"zigpty","version":"0.1.0","_id":"zigpty@0.1.0","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/pithings/zigpty#readme","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"dist":{"shasum":"ba28ad20ca5d365cee0cab466036bfaf24429471","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.1.0.tgz","fileCount":13,"integrity":"sha512-qS42OfL71Ya66qwf3Z/HvgC9eDtdCZwPTS6m4/wMXFnfQoGWOuTtTdaTwK5bE02oL7n/c7iJP9ux7famHJHMww==","signatures":[{"sig":"MEUCIQDW2gYVJX0C13pPMzVcZxdy15Yw+LNVYdl5mL65VAoYrwIgUdqRxERoOgOARKXD/9NTFDCQsYqM7gwCb5XI4pRB6OE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/zigpty@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":247388},"type":"module","exports":{".":"./dist/index.mjs"},"gitHead":"7814e6c660a532eeba1f0281aab91f8205515eea","scripts":{"fmt":"oxfmt . && zig fmt zig/","test":"zig build test && vitest run","build":"zig build --release && obuild","release":"bun run build && changelogen --release --push","test:bun":"zig build test && bun test","build:zig":"zig build --release","fmt:check":"oxfmt --check . && zig fmt --check zig/","build:zig:debug":"zig build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:777c7a27-2fd5-443f-be25-b3a9e3bd04fd"}},"repository":{"url":"git+https://github.com/pithings/zigpty.git","type":"git"},"_npmVersion":"11.11.0","description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, and Windows (via ConPTY).","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"packageManager":"bun@1.3.11","devDependencies":{"oxfmt":"^0.44.0","obuild":"^0.4.33","vitest":"^4.1.3","@types/bun":"^1.3.11","typescript":"^6.0.2","@types/node":"^25.5.2","changelogen":"^0.6.2"},"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.1.0_1775663912861_0.2281161920856738","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"zigpty","version":"0.1.1","_id":"zigpty@0.1.1","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/pithings/zigpty#readme","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"dist":{"shasum":"bc68f495be333ddc8048ba69c57a5e3d280cfde3","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.1.1.tgz","fileCount":13,"integrity":"sha512-rtiutBJwLlHK7Myn6ou7X80ZqmvEor0NOb2bQd49stm4bqgrApV6b+ED//aFO//pmNVquky18I41zm2jKq9hZg==","signatures":[{"sig":"MEUCIQC3z0Pg6MfTZ32KbnzT+YnjdYv4lpu2szhqrwo2C+rDSAIgI7s415IFUrXllN+hNcHlH6fZAKOg3oqiwlD7yN1xpGY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/zigpty@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":252248},"type":"module","exports":{".":"./dist/index.mjs"},"gitHead":"104cdbb1f0f1b98664ef4a8b4459156b6bd38204","scripts":{"fmt":"oxfmt . && zig fmt zig/","test":"zig build test && vitest run","build":"zig build --release && obuild","release":"bun test && changelogen --release --push","test:bun":"zig build test && bun test","build:zig":"zig build --release","fmt:check":"oxfmt --check . && zig fmt --check zig/","build:zig:debug":"zig build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:777c7a27-2fd5-443f-be25-b3a9e3bd04fd"}},"repository":{"url":"git+https://github.com/pithings/zigpty.git","type":"git"},"_npmVersion":"11.11.0","description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, Android and Windows (via ConPTY).","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"packageManager":"bun@1.3.11","devDependencies":{"oxfmt":"^0.44.0","obuild":"^0.4.33","vitest":"^4.1.3","@types/bun":"^1.3.11","typescript":"^6.0.2","@types/node":"^25.5.2","changelogen":"^0.6.2"},"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.1.1_1775684367745_0.48595898404005156","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"zigpty","version":"0.1.2","_id":"zigpty@0.1.2","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/pithings/zigpty#readme","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"dist":{"shasum":"d3aa89cb4e289b6e1978dc1dfd04dfaece7bc32d","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.1.2.tgz","fileCount":13,"integrity":"sha512-qHlId90Ta0tMpU+rakWbT74QQeupO2XLhIUiUxslqEw1ON+1U03wXPIJRAR0xjxMEHXHi4NDjXFFeiVE1lKK1w==","signatures":[{"sig":"MEUCIH0Oy0JK3alb3yezpOq6iVowrvKPg3w/A7d23v1zHwmkAiEA+/mTh/V6ovxu41JhcezfAKSLXJX60LgThn6HtPIwQa0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/zigpty@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":252848},"type":"module","exports":{".":"./dist/index.mjs"},"gitHead":"c98265ff85a66e6023226c73c134b8480355a8eb","scripts":{"fmt":"oxfmt . && zig fmt zig/","test":"zig build test && vitest run","build":"zig build --release && obuild","release":"bun test && changelogen --release --push","test:bun":"zig build test && bun test","build:zig":"zig build --release","fmt:check":"oxfmt --check . && zig fmt --check zig/","build:zig:debug":"zig build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:777c7a27-2fd5-443f-be25-b3a9e3bd04fd"}},"repository":{"url":"git+https://github.com/pithings/zigpty.git","type":"git"},"_npmVersion":"11.11.0","description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, Android and Windows (via ConPTY).","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"packageManager":"bun@1.3.11","devDependencies":{"oxfmt":"^0.44.0","obuild":"^0.4.33","vitest":"^4.1.3","@types/bun":"^1.3.11","typescript":"^6.0.2","@types/node":"^25.5.2","changelogen":"^0.6.2"},"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.1.2_1775687475037_0.36306481774572297","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"zigpty","version":"0.1.3","_id":"zigpty@0.1.3","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/pithings/zigpty#readme","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"dist":{"shasum":"2ec0fd505c59785d5f6028ef82ffb5db901ef940","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.1.3.tgz","fileCount":13,"integrity":"sha512-95fPNydA3nx7w61yDHMpKJlObjlaHsl1ZN5LR+6l6NuOjPAY6KFMEqiKoYPWHVA72w1Ufh3oX17RAdNN5tdFAQ==","signatures":[{"sig":"MEQCICwq9fbyiimbllI1n90/SGm8aE865rNEgSwrSplouy0QAiA23S6jdx2XMRjaAOffWohbjN8LpC1JeFbHWm8rBoCCNw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/zigpty@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":252652},"type":"module","exports":{".":"./dist/index.mjs"},"gitHead":"a94c7ca4da5000d5f8a84440590bb45c8e529ed2","scripts":{"fmt":"oxfmt . && zig fmt zig/","test":"zig build test && vitest run","build":"zig build --release && obuild","release":"bun run test && changelogen --release --push","test:bun":"zig build test && bun test","build:zig":"zig build --release","fmt:check":"oxfmt --check . && zig fmt --check zig/","build:zig:debug":"zig build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:777c7a27-2fd5-443f-be25-b3a9e3bd04fd"}},"repository":{"url":"git+https://github.com/pithings/zigpty.git","type":"git"},"_npmVersion":"11.11.0","description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, Android and Windows (via ConPTY).","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"packageManager":"bun@1.3.11","devDependencies":{"oxfmt":"^0.44.0","obuild":"^0.4.33","vitest":"^4.1.3","@types/bun":"^1.3.11","typescript":"^6.0.2","@types/node":"^25.5.2","changelogen":"^0.6.2"},"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.1.3_1775743399375_0.322016234519213","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"zigpty","version":"0.1.4","_id":"zigpty@0.1.4","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/pithings/zigpty#readme","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"dist":{"shasum":"061bba7480d2fac2be0720a4ec6fa0769836eb3d","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.1.4.tgz","fileCount":13,"integrity":"sha512-lpJ1LZVVdEPUXOUgiGzhTIyMVaDH8nv54yPgRduyxVywjmkjWBeI2/gW78rZunK2ZDjPv5OC0hD3tUrkh25SNA==","signatures":[{"sig":"MEQCIHUJP3gxCbRFfZZ/n45X137UjYgizSUfwSzWLy0gH22fAiBvkk4mhvhXScZa63gtKGq4K4tur60u5PhByK55pcwSFg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/zigpty@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":253436},"type":"module","exports":{".":"./dist/index.mjs"},"gitHead":"500ce687b4349a9479136ca099ab22c9018d7285","scripts":{"fmt":"oxfmt . && zig fmt zig/","test":"zig build test && vitest run","build":"zig build --release && obuild","release":"bun run test && changelogen --release --push","test:bun":"zig build test && bun test","build:zig":"zig build --release","fmt:check":"oxfmt --check . && zig fmt --check zig/","build:zig:debug":"zig build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:777c7a27-2fd5-443f-be25-b3a9e3bd04fd"}},"repository":{"url":"git+https://github.com/pithings/zigpty.git","type":"git"},"_npmVersion":"11.11.0","description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, Android and Windows (via ConPTY).","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"packageManager":"bun@1.3.11","devDependencies":{"oxfmt":"^0.44.0","obuild":"^0.4.33","vitest":"^4.1.3","@types/bun":"^1.3.11","typescript":"^6.0.2","@types/node":"^25.5.2","changelogen":"^0.6.2"},"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.1.4_1775746235313_0.7911149000284472","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"zigpty","version":"0.1.5","_id":"zigpty@0.1.5","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/pithings/zigpty#readme","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"dist":{"shasum":"cdd75adb90cc2bacff8012c609376fb1c2da21cc","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.1.5.tgz","fileCount":13,"integrity":"sha512-zVESR8e9V2i0OBlguYHbE5jTEPZ21y8Jp+3UO3HbmzcGYjv+OE2YGwu9qy9qmZRdsMwlD5pGFgvLhVnGrVgDYQ==","signatures":[{"sig":"MEYCIQDxlliXIE/lD0TIaAVAbMBvF1wYTCoiDS7cJdc3jmWw2wIhAMye4o/D1Cm7nOHufG19WqQMhHVqnpVtrQjk3Pel3oVw","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/zigpty@0.1.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":253620},"type":"module","exports":{".":"./dist/index.mjs"},"gitHead":"b80263addc5418e7c50364bd54563faf9c0de161","scripts":{"fmt":"oxfmt . && zig fmt zig/","test":"zig build test && vitest run","build":"zig build --release && obuild","release":"bun run test && changelogen --release --push","test:bun":"zig build test && bun test","build:zig":"zig build --release","fmt:check":"oxfmt --check . && zig fmt --check zig/","build:zig:debug":"zig build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:777c7a27-2fd5-443f-be25-b3a9e3bd04fd"}},"repository":{"url":"git+https://github.com/pithings/zigpty.git","type":"git"},"_npmVersion":"11.11.0","description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, Android and Windows (via ConPTY).","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"packageManager":"bun@1.3.11","devDependencies":{"oxfmt":"^0.44.0","obuild":"^0.4.33","vitest":"^4.1.3","@types/bun":"^1.3.11","typescript":"^6.0.2","@types/node":"^25.5.2","changelogen":"^0.6.2"},"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.1.5_1775747238540_0.8516268048959554","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"zigpty","version":"0.1.6","_id":"zigpty@0.1.6","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/pithings/zigpty#readme","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"dist":{"shasum":"b68e667be9ef95ad751fead743ee81c6bb1e9c59","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.1.6.tgz","fileCount":13,"integrity":"sha512-0B+6Xa4mKgyTNMq87HoGEUb30jQ08DZLEshSlgXPvUv+GB3E0zuTM+IUuYqe0CiaZyaZvCyx9snvGqxIKhl0sA==","signatures":[{"sig":"MEUCIQDkES4rOp17XCuNn0AXOvXC6/tHLlhOgFHEHHcl820NcwIgbjI1EtOroM2ANdnlHTTiF+B/K8ZKSRd69iPkFM7qhqQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/zigpty@0.1.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":342238},"type":"module","exports":{".":"./dist/index.mjs"},"gitHead":"54392f8fe9c9028f0f6388513a55323d9da21f2c","scripts":{"fmt":"oxfmt . && zig fmt zig/","test":"zig build test && vitest run","build":"zig build --release && obuild","release":"bun run test && changelogen --release --push","test:bun":"zig build test && bun test","build:zig":"zig build --release","fmt:check":"oxfmt --check . && zig fmt --check zig/","build:zig:debug":"zig build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:777c7a27-2fd5-443f-be25-b3a9e3bd04fd"}},"repository":{"url":"git+https://github.com/pithings/zigpty.git","type":"git"},"workspaces":["playground"],"_npmVersion":"11.11.0","description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, Android and Windows (via ConPTY).","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"packageManager":"bun@1.3.11","devDependencies":{"oxfmt":"^0.44.0","obuild":"^0.4.33","vitest":"^4.1.3","@types/bun":"^1.3.11","typescript":"^6.0.2","@types/node":"^25.5.2","changelogen":"^0.6.2"},"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.1.6_1775944913980_0.9814920375737424","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"zigpty","version":"0.2.0","_id":"zigpty@0.2.0","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/pithings/zigpty#readme","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"dist":{"shasum":"835772eae976e76ca585aa4d18d61f6c3194e8d4","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.2.0.tgz","fileCount":18,"integrity":"sha512-rEn53TjljnMVzuCi5Rx9/Do0iZkq6y+71BMOX7tBVD2DSfOyCEKobNRXHWBUkC38g3nLjSaPU2bB/hLALY7HYg==","signatures":[{"sig":"MEQCIBb2tzBUrG6AnXiYq/0E15OguUJ3AGnFAbv8UvkmUsrzAiBGqYUxlyesHNUpIoJW0SeXDuPRjiIv04XW7zY6jHzDLA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/zigpty@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":419233},"type":"module","exports":{".":"./dist/index.mjs","./osc":"./dist/osc/index.mjs","./idle":"./dist/idle/index.mjs"},"gitHead":"c004690d1849d13219963810a60633d1f58243a1","scripts":{"fmt":"oxfmt . && zig fmt zig/","test":"zig build test && vitest run","build":"zig build --release && obuild","release":"bun run test && changelogen --release --push","test:bun":"zig build test && bun test","build:zig":"zig build --release","fmt:check":"oxfmt --check . && zig fmt --check zig/","build:zig:debug":"zig build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:777c7a27-2fd5-443f-be25-b3a9e3bd04fd"}},"repository":{"url":"git+https://github.com/pithings/zigpty.git","type":"git"},"workspaces":["playground"],"_npmVersion":"11.12.1","description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, Android and Windows (via ConPTY).","directories":{},"_nodeVersion":"24.15.0","_hasShrinkwrap":false,"packageManager":"bun@1.3.11","devDependencies":{"oxfmt":"^0.44.0","obuild":"^0.4.33","vitest":"^4.1.3","@types/bun":"^1.3.11","typescript":"^6.0.2","@types/node":"^25.5.2","changelogen":"^0.6.2"},"_npmOperationalInternal":{"tmp":"tmp/zigpty_0.2.0_1779884960433_0.520514053798355","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"zigpty","version":"0.2.1","repository":{"type":"git","url":"git+https://github.com/pithings/zigpty.git"},"workspaces":["playground"],"type":"module","exports":{".":"./dist/index.mjs","./osc":"./dist/osc/index.mjs","./idle":"./dist/idle/index.mjs"},"scripts":{"build":"zig build --release && obuild","build:zig":"zig build --release","build:zig:debug":"zig build","fmt":"oxfmt . && zig fmt zig/","fmt:check":"oxfmt --check . && zig fmt --check zig/","test":"zig build test && vitest run","test:bun":"zig build test && bun test","release":"bun run test && changelogen --release --push"},"devDependencies":{"@types/bun":"^1.3.11","@types/node":"^25.5.2","changelogen":"^0.6.2","obuild":"^0.4.33","oxfmt":"^0.44.0","typescript":"^6.0.2","vitest":"^4.1.3"},"packageManager":"bun@1.3.11","gitHead":"60a6002851bbe489ca48c3b1964be34d36e04173","_id":"zigpty@0.2.1","description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, Android and Windows (via ConPTY).","bugs":{"url":"https://github.com/pithings/zigpty/issues"},"homepage":"https://github.com/pithings/zigpty#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-MR9JqJx2wf5f4wz8zpx050AlqrmWeIW+1h0SO5iEyhG3HFRjY5luC3szS2ux2EGuPjE5OU9ZAuiCBeMWBTrqZw==","shasum":"9ca77e122f9b833d59743e868fafb8550e9c278f","tarball":"https://registry.npmjs.org/zigpty/-/zigpty-0.2.1.tgz","fileCount":18,"unpackedSize":421847,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/zigpty@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFANydcalbAB86SVjfxX7usoCXflwCNIvaNuNOle9Rd2AiEA0CmlJ7rLgj8RTz4EPEtTPNIpIPdm9SZ990S0YJ4Gq04="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:777c7a27-2fd5-443f-be25-b3a9e3bd04fd"}},"directories":{},"maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/zigpty_0.2.1_1782127955342_0.7178405829806949"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-21T19:54:26.754Z","modified":"2026-06-22T11:32:35.749Z","0.0.0":"2026-03-21T19:54:26.888Z","0.0.2":"2026-03-21T21:21:14.534Z","0.0.3":"2026-03-22T11:14:34.971Z","0.0.4":"2026-03-22T14:11:00.488Z","0.0.6":"2026-04-08T09:37:42.634Z","0.0.7":"2026-04-08T15:52:20.749Z","0.1.0":"2026-04-08T15:58:33.006Z","0.1.1":"2026-04-08T21:39:27.916Z","0.1.2":"2026-04-08T22:31:15.225Z","0.1.3":"2026-04-09T14:03:19.597Z","0.1.4":"2026-04-09T14:50:35.473Z","0.1.5":"2026-04-09T15:07:18.696Z","0.1.6":"2026-04-11T22:01:54.108Z","0.2.0":"2026-05-27T12:29:20.609Z","0.2.1":"2026-06-22T11:32:35.512Z"},"bugs":{"url":"https://github.com/pithings/zigpty/issues"},"homepage":"https://github.com/pithings/zigpty#readme","repository":{"type":"git","url":"git+https://github.com/pithings/zigpty.git"},"description":"Tiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, Android and Windows (via ConPTY).","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"readme":"# zigpty\n\nTiny, cross-platform PTY library for Node.js, built in Zig, also usable as a standalone Zig package. Supports Linux, macOS, Android and Windows (via ConPTY).\n\nDrop-in replacement for [`node-pty`](https://github.com/microsoft/node-pty). **350x smaller** (43 KB vs 15.5 MB packed, 176 KB vs 64.4 MB installed), no `node-gyp` or C++ compiler needed, and ships musl prebuilds for Alpine.\n\n## Use cases\n\nRegular `child_process.spawn()` runs programs without a terminal attached. That means no colors, no cursor control, no prompts — programs like `vim`, `top`, `htop`, or interactive shells simply don't work. A **PTY** (pseudo-terminal) makes the subprocess think it's connected to a real terminal. Colors, line editing, full-screen TUIs, and terminal resizing all work as expected.\n\n- **Terminal emulators** — embed a terminal in Electron, Tauri, or a web app\n- **Remote shells** — stream a PTY over WebSocket from a Node.js server\n- **CI / automation** — run programs that require a TTY (interactive installers, REPLs)\n- **Testing** — test CLI tools that use colors, prompts, or cursor movement\n- **AI agents** — give LLM agents a real shell to run commands, observe output, and interact with CLIs\n\n## Usage\n\n```ts\nimport { spawn } from \"zigpty\";\n\n// auto-detects default shell ($SHELL on Unix, %COMSPEC% on Windows)\nconst pty = spawn(undefined, [], {\n  cols: 80,\n  rows: 24,\n  terminal: {\n    data(terminal, data: Uint8Array) {\n      process.stdout.write(data);\n    },\n  },\n  onExit(exitCode, signal) {\n    console.log(\"exited:\", exitCode);\n  },\n});\n\npty.write(\"echo hello\\n\");\npty.resize(120, 40);\nawait pty.exited; // Promise<number>\n```\n\nTerminal callbacks bypass Node.js streams and deliver raw `Uint8Array` directly from native code. You can also use the `onData`/`onExit` event listeners instead:\n\n```ts\npty.onData((data) => process.stdout.write(data));\npty.onExit(({ exitCode }) => console.log(\"exited:\", exitCode));\n```\n\nBoth `spawn()` and `Terminal` support automatic disposal — `await using` for `spawn()` waits for the process to actually exit, and `using` for `Terminal` closes the PTY synchronously:\n\n```ts\nimport { spawn, Terminal } from \"zigpty\";\n\nusing terminal = new Terminal({\n  data(term, data) {\n    process.stdout.write(data);\n  },\n});\n\n{\n  await using pty = spawn(\"/bin/sh\", [\"-c\", \"echo hello\"], { terminal });\n  // ...do stuff...\n} // pty.close() runs; block awaits process exit before continuing\n// terminal.close() runs when the outer scope exits\n```\n\n## API\n\n### `spawn(file, args?, options?)`\n\nSpawn a process inside a new PTY.\n\n**Options:**\n\n```ts\ninterface IPtyOptions {\n  cols?: number; // Default: 80\n  rows?: number; // Default: 24\n  cwd?: string; // Default: process.cwd()\n  env?: Record<string, string>; // Default: process.env\n  name?: string; // Sets TERM (e.g. \"xterm-256color\")\n  encoding?: BufferEncoding | null; // Default: \"utf8\", null for raw Buffer\n  uid?: number; // Unix user ID\n  gid?: number; // Unix group ID\n  handleFlowControl?: boolean; // Intercept XON/XOFF (default: false)\n  pipe?: boolean; // Force pipe-based fallback (default: false)\n  terminal?: TerminalOptions | Terminal; // Bun-compatible terminal callbacks\n  onExit?: (exitCode: number, signal: number) => void;\n}\n```\n\n**Returns:**\n\n```ts\ninterface IPty {\n  pid: number;\n  cols: number;\n  rows: number;\n  readonly process: string; // Foreground process name\n  readonly exited: Promise<number>; // Resolves with exit code\n  readonly exitCode: number | null; // Exit code or null if running\n\n  onData: (cb: (data: string | Buffer) => void) => IDisposable;\n  onExit: (cb: (e: { exitCode: number; signal: number }) => void) => IDisposable;\n\n  write(data: string): void;\n  resize(cols: number, rows: number): void;\n  kill(signal?: string): void; // Default: SIGHUP\n  pause(): void;\n  resume(): void;\n  close(): void;\n  waitFor(pattern: string, options?: { timeout?: number }): Promise<string>;\n  stats(): IPtyStats | null; // OS-level snapshot (cwd, memory, CPU time)\n  attach(consumer: IPtyConsumer): IDisposable; // Wire a sink to the data stream\n}\n```\n\n### `pty.stats()`\n\nSnapshot OS-level process info aggregated across the spawned process and **every transitive descendant** (BFS by ppid). If you spawn `bash`, the totals cover bash + every command, subshell, background job, pipeline, and grandchild it spawned. `rssBytes`, `cpuUser`, and `cpuSys` are **totals** summed over the leader and every tracked descendant. `count` is how many processes were rolled into the totals. `children[]` lists each non-leader descendant (`{pid, name, rssBytes, cpuUser, cpuSys}`) so you can see the breakdown.\n\nThe same descendant-tree model applies on every platform — pgrp/session/job-control juggling doesn't matter, since the walk follows ppid edges. The only thing not tracked is **double-fork daemons** (`nohup`, `setsid` + intermediate exit) that explicitly reparent away to init/launchd.\n\n```ts\nconst pty = spawn(\"/bin/bash\");\n// …user types `cd /tmp && cargo build`…\nconst s = pty.stats();\n// {\n//   pid: 4821,               // leader (the spawned shell)\n//   cwd: \"/tmp\",             // leader's cwd; null on Windows\n//   rssBytes: 2_147_483_648, // total across leader + descendants\n//   cpuUser: 8_430_000,      // microseconds\n//   cpuSys: 1_250_000,\n//   count: 17,               // leader + 16 descendants\n//   children: [\n//     { pid: 4822, name: \"cargo\",   rssBytes: 128_000_000, cpuUser: 500_000, cpuSys: 80_000 },\n//     { pid: 4823, name: \"rustc\",   rssBytes: 512_000_000, cpuUser: 2_000_000, cpuSys: 300_000 },\n//     // …14 more…\n//   ],\n// }\n```\n\nReturns `null` when stats can't be read (process exited, PTY closed, or running in pipe fallback on non-Linux). Polling is on-demand — no background thread, no cost when unused.\n\n### `pty.waitFor(pattern, options?)`\n\nWait until the PTY output contains the given string. Returns all output collected so far. Useful for AI agents that need to read prompts before responding.\n\n```ts\nimport { spawn, Terminal } from \"zigpty\";\n\n// Terminal provides callback-based data handling and `using` cleanup\nusing terminal = new Terminal({\n  cols: 100,\n  rows: 30,\n  // Nice to meet you, zigpty! Zig is a great choice!\n  data: (_terminal, data) => process.stdout.write(data),\n});\n\n// spawn() attaches to the Terminal — data flows through terminal callbacks\nconst pty = spawn(\n  \"python3\",\n  [\n    \"-c\",\n    `\nname = input(\"What is your name? \")\nlang = input(\"Favorite language? \")\nprint(f\"Nice to meet you, {name}! {lang} is a great choice!\")\n`,\n  ],\n  { terminal },\n);\n\n// waitFor() resolves when the output contains the pattern\nawait pty.waitFor(\"name?\");\npty.write(\"zigpty\\n\");\n\nawait pty.waitFor(\"language?\");\npty.write(\"Zig\\n\");\n\n// exited returns a Promise<number> with the exit code\nawait pty.exited;\n```\n\nOptions: `{ timeout?: number }` — default 30 seconds. Throws if the pattern is not found within the timeout.\n\n### `pty.attach(consumer)`\n\nWire a generic sink to the PTY's data stream. Anything with a `feed(data)` method conforms to `IPtyConsumer` — including the built-in `OSCInspector`, a file logger, an in-memory recorder, a WebSocket forwarder, etc. The consumer is auto-detached when the PTY exits.\n\n```ts\ninterface IPtyConsumer {\n  feed(data: string | Buffer): void;\n  onAttach?(pty: IPty): void; // optional — fires once before the first feed\n  onDetach?(pty: IPty): void; // optional — fires on dispose or PTY exit\n}\n```\n\n```ts\nconst recorder = {\n  chunks: [] as Buffer[],\n  feed(data) {\n    this.chunks.push(typeof data === \"string\" ? Buffer.from(data) : data);\n  },\n};\n\nconst sub = pty.attach(recorder);\n// ...\nsub.dispose(); // detach early; otherwise auto-detached on PTY exit\n```\n\nMultiple consumers per PTY are supported and run independently.\n\n### OSC inspector — `zigpty/osc`\n\nParse OSC (Operating System Command) escape sequences out of any byte stream — title changes, CWD updates, shell-integration marks (OSC 133/633), progress, notifications, and more. The inspector is a pure-TS byte-fed state machine; sequences split across chunks are stitched back together.\n\n```ts\nimport { spawn } from \"zigpty\";\nimport { OSCInspector, decodeOSC } from \"zigpty/osc\";\n\nconst inspector = new OSCInspector((event) => {\n  // event = { code: number, payload: string }\n  const decoded = decodeOSC(event);\n  switch (decoded.kind) {\n    case \"title\":\n      console.log(\"title:\", decoded.title);\n      break;\n    case \"cwd\":\n      // Unified across OSC 7, ConEmu 9;9, and iTerm2 1337;CurrentDir=\n      console.log(`cwd (${decoded.source}):`, decoded.path);\n      break;\n    case \"shellIntegration\":\n      // OSC 133/633 — command is A/B/C/D (or vscode-specific tokens)\n      console.log(`${decoded.vendor}/${decoded.command}`, decoded.data);\n      break;\n    case \"notification\":\n      console.log(\"notify:\", decoded.title, decoded.body);\n      break;\n    case \"progress\":\n      // ConEmu/Windows Terminal taskbar progress (OSC 9;4)\n      console.log(`progress: state=${decoded.state} value=${decoded.value}`);\n      break;\n    case \"mark\":\n      // OSC 1337 SetMark / OSC 9;12 ConEmu prompt-start mark\n      console.log(\"prompt mark from\", decoded.vendor);\n      break;\n    case \"hyperlink\":\n      console.log(decoded.action, decoded.uri); // \"open\"|\"close\"\n      break;\n    // ...attention, clipboard, userVar, remoteHost,\n    // shellIntegrationVersion, unknown\n  }\n});\n\nconst pty = spawn(\"/bin/bash\");\npty.attach(inspector); // OSCInspector implements IPtyConsumer\n```\n\n**Stateful inspection** — the inspector maintains an `OSCState` snapshot of the durable, observable state seen so far (title, icon name, cwd, active hyperlink, taskbar progress, remote host, shell-integration version, user vars). State is updated in place before listeners fire, so handlers can read fresh values. Action-like sequences (notifications, marks, clipboard writes, attention requests) don't touch state.\n\n```ts\nconst inspector = new OSCInspector();\npty.attach(inspector);\n\ninspector.onStateChange((state) => {\n  // Fires only on sequences that actually mutated state.\n  console.log(\"title:\", state.title);\n  console.log(\"cwd:\", state.cwd?.path);\n  console.log(\"progress:\", state.progress); // undefined after \"remove\" (state 0)\n  console.log(\"hyperlink:\", state.hyperlink?.uri); // undefined between links\n});\n\n// Or pull synchronously at any time:\ninspector.state.title; // string | undefined\ninspector.state.userVars?.greeting; // base64-decoded SetUserVar values\n```\n\nSpecifics: OSC 0 sets both `title` and `iconName`; OSC 1 sets `iconName` only; OSC 2 sets `title` only. `cwd` is unified across OSC 7, OSC 1337 `CurrentDir=`, and OSC 9;9 with a `source` discriminator. `hyperlink` is cleared on OSC 8 close (empty URI). `progress` is cleared when state 0 is reported. `dispose()` clears state.\n\n**Decoded shapes** (`DecodedOSC` union) cover the common codes out of the box:\n\n| Code            | `kind`(s)                                                                                         | Notes                                                                                                                                                    |\n| --------------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `0` / `1` / `2` | `title`                                                                                           | Window / tab / icon title. C0 control bytes stripped.                                                                                                    |\n| `7`             | `cwd` (`source: \"osc7\"`)                                                                          | `<scheme>://<host>/<path>`. Path is percent-decoded; `host`/`scheme`/`local` exposed.                                                                    |\n| `8`             | `hyperlink`                                                                                       | `action: \"open\" \\| \"close\"`; `id`, `uri`, and `params`. Empty URI = close.                                                                               |\n| `9`             | `progress` / `cwd` / `mark` / `notification`                                                      | `9;4;…` progress, `9;9;…` ConEmu/WT CWD report, `9;12` prompt mark, `9;<text>` iTerm2 Growl-style notification.                                          |\n| `52`            | `clipboard`                                                                                       | Set, query (`?`), or `clear` (Pd not base64). Multi-char `Pc` exposed via `selections[]`.                                                                |\n| `99`            | `notification` (`vendor: \"kitty\"`)                                                                | Title / body / phase (`close`, `alive`, `icon`, …); honors `i=` (id), `u=` (urgency), `d=0` (partial chunk), `e=1` (base64 payload).                     |\n| `133`           | `shellIntegration` (`vendor: \"vt\"`)                                                               | FinalTerm A/B/C/D. `D` parses exit code + `err=`; `A`/`C` parse kitty extras into `params`.                                                              |\n| `633`           | `shellIntegration` (`vendor: \"vscode\"`)                                                           | A/B/C/D/E/P/EnvSingleStart/EnvSingleEntry/EnvSingleEnd. Applies VSCode `\\\\`/`\\xNN` unescaping.                                                           |\n| `777`           | `notification` (`vendor: \"rxvt\"`)                                                                 | `notify;<title>;<body>` from the urxvt-perl extension.                                                                                                   |\n| `1337`          | `attention` / `cwd` / `mark` / `userVar` / `remoteHost` / `clipboard` / `shellIntegrationVersion` | iTerm2: `RequestAttention` (`yes`/`no`/`once`/`fireworks`), `CurrentDir=`, `SetMark`, `SetUserVar=`, `RemoteHost=`, `Copy=`, `ShellIntegrationVersion=`. |\n| _other_         | `unknown`                                                                                         | Raw `{code, payload}` preserved.                                                                                                                         |\n\n**Adding custom decoders** — use `createOSCDecoder()` to register handlers for new codes (or override built-ins). The returned function is typed as `DecodedOSC | <your custom kinds>`:\n\n```ts\nimport { createOSCDecoder } from \"zigpty/osc\";\n\nconst decode = createOSCDecoder({\n  // OSC 50 — terminal font (xterm), not handled by built-ins\n  50: (payload) => ({ kind: \"font\" as const, value: payload }),\n  // OSC 1338 — your custom vendor code\n  1338: (payload) => ({ kind: \"vendor-x\" as const, raw: payload }),\n});\n\nconst inspector = new OSCInspector((event) => {\n  const d = decode(event);\n  // d: DecodedOSC | { kind: \"font\"; ... } | { kind: \"vendor-x\"; ... }\n});\n```\n\nThe built-in registry is exposed as `builtinOSCDecoders: Record<number, OSCDecoderFn<DecodedOSC>>` if you want to inspect or reuse individual decoders.\n\n### Idle detector — `zigpty/idle`\n\nImplicit terminal-attention detection. Watches the PTY's output stream and emits an `idle` event when a burst of activity stops — typically meaning an interactive agent (Claude Code, aider, a REPL, …) is done streaming and waiting for input. Tuned to suppress the obvious false positives: the startup banner flood, tiny status-bar updates, and pure ANSI redraws.\n\n```ts\nimport { spawn } from \"zigpty\";\nimport { IdleDetector } from \"zigpty/idle\";\n\nconst detector = new IdleDetector((event) => {\n  if (event.type === \"active\") console.log(\"agent started producing output\");\n  if (event.type === \"idle\") console.log(\"agent likely waiting for input\");\n});\n\nconst pty = spawn(\"claude\", []);\npty.attach(detector); // IdleDetector implements IPtyConsumer\n```\n\nHow it filters false positives:\n\n| Knob              | Default | What it does                                                                                                                                                                 |\n| ----------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `graceMs`         | `1500`  | Significant bytes arriving within this window after `attach` are silently absorbed. Hides the shell-init / prompt-render flood that always happens right when a PTY opens.   |\n| `activeThreshold` | `512`   | Minimum significant bytes in a single burst (gaps shorter than `quietMs`) before `active` fires. Status-bar pokes and cursor-blink redraws never accumulate enough to count. |\n| `quietMs`         | `750`   | Time with no significant bytes before transitioning `active` → `idle`. Tuned for streaming agents that emit chunks every 50-200ms.                                           |\n\n\"Significant bytes\" excludes ANSI/CSI/OSC escape sequences and other C0 control characters — only user-visible content counts toward the threshold, so heavily colored output doesn't masquerade as text and a pure spinner redraw contributes very few bytes per cycle.\n\n`IdleDetector` has the same shape as `OSCInspector`: pass a listener (or `.on()` later), `.feed()` raw bytes if you're driving it yourself, and `.dispose()` to clean up. Events carry the burst `bytes` count and transition `durationMs` if you want to introspect output:\n\n```ts\ntype IdleEvent = {\n  type: \"active\" | \"idle\";\n  bytes: number; // significant bytes accumulated for the output burst\n  durationMs: number; // how long the previous state lasted\n};\n```\n\n### `hasNative`\n\nBoolean — `true` when native Zig PTY bindings loaded successfully, `false` when running in pipe fallback mode.\n\n### `open(options?)`\n\nCreate a PTY pair without spawning a process — useful when you need to control the child process yourself.\n\n```ts\nimport { open } from \"zigpty\";\n\nconst { master, slave, pty } = open({ cols: 80, rows: 24 });\n```\n\n## Pipe fallback\n\nWhen native Zig PTY bindings can't load (missing prebuilds, sandboxed containers, WASM, minimal libc), `spawn()` automatically falls back to a pure-TypeScript pipe-based PTY instead of crashing. This covers containers without `/dev/ptmx`, CI environments without prebuilds, and restricted runtimes.\n\nYou can also force the pipe fallback explicitly with the `pipe` option:\n\n```ts\nimport { spawn, hasNative } from \"zigpty\";\n\n// Automatic — uses native if available, pipes otherwise\nconst pty = spawn(\"ls\", [\"-la\"]);\n\n// Explicit — force pipe mode even when native is available\nconst pty = spawn(\"ls\", [\"-la\"], { pipe: true });\n```\n\nYou can also use `PipePty` directly:\n\n```ts\nimport { PipePty } from \"zigpty\";\n\nconst pty = new PipePty(\"/bin/sh\", [\"-c\", \"echo hello\"]);\n```\n\nThe pipe fallback emulates terminal behavior where possible:\n\n- **Signal translation** — `^C`→SIGINT, `^Z`→SIGTSTP, `^\\`→SIGQUIT, `^D`→EOF\n- **Line discipline** — canonical mode with echo, backspace, `^W` word erase, `^U` line kill\n- **Flow control** — XON/XOFF interception (when `handleFlowControl` is enabled)\n- **Force-color hints** — auto-sets `FORCE_COLOR=1` and `COLORTERM=truecolor`\n- **Resize** — sends `SIGWINCH` to the child process as a best-effort hint\n- **Process tracking** — reads foreground process name from `/proc` on Linux\n\nRaw mode (no echo, no line buffering) is available via `setRawMode()` / `setCanonicalMode()` on `PipePty` instances.\n\n**Known limitations** — programs see `isatty()` → false, no kernel-level TIOCSWINSZ, `open()` throws in fallback mode.\n\n## Platform support\n\n| Platform            | Status |\n| ------------------- | ------ |\n| Linux x64 (glibc)   | ✅     |\n| Linux x64 (musl)    | ✅     |\n| Linux arm64 (glibc) | ✅     |\n| Linux arm64 (musl)  | ✅     |\n| macOS x64           | ✅     |\n| macOS arm64         | ✅     |\n| Windows x64         | ✅     |\n| Windows arm64       | ✅     |\n\nAll 8 platform binaries are prebuilt — no compiler needed at install time. On Linux, the native loader tries glibc first and falls back to musl automatically.\n\n## Zig package\n\nThe PTY core is a standalone Zig package with no Node.js or NAPI dependency.\n\n```sh\nzig fetch --save git+https://github.com/pithings/zigpty.git\n```\n\nWire it up in `build.zig`:\n\n```zig\nconst zigpty = b.dependency(\"zigpty\", .{ .target = target, .optimize = optimize });\nexe.root_module.addImport(\"zigpty\", zigpty.module(\"zigpty\"));\n```\n\nAPI:\n\n```zig\nconst pty = @import(\"zigpty\");\n\n// Fork a process with a PTY\nconst result = try pty.forkPty(.{\n    .file = \"/bin/bash\",\n    .argv = &.{ \"/bin/bash\", null },\n    .envp = &.{ \"TERM=xterm-256color\", null },\n    .cwd = \"/home/user\",\n    .cols = 120,\n    .rows = 40,\n});\n// result.fd  — PTY file descriptor (read/write)\n// result.pid — child process ID\n\n// Open a bare PTY pair (no process spawned)\nconst pair = try pty.openPty(80, 24);\n// pair.master, pair.slave\n\n// Resize\ntry pty.resize(result.fd, 80, 24, 0, 0);\n\n// Foreground process name\nvar buf: [4096]u8 = undefined;\nconst name: ?[]const u8 = pty.getProcessName(result.fd, &buf);\n\n// Block until child exits\nconst exit_info = pty.waitForExit(result.pid);\n// exit_info.exit_code, exit_info.signal_code\n```\n\n## Building from source\n\nRequires [Zig](https://ziglang.org/) 0.16.0+.\n\n```sh\nzig build              # Build prebuilds (all targets)\nzig build --release    # Release build\nbun run build          # Build + bundle TypeScript\nbun test               # Run tests\n```\n\n## Sponsors\n\n<p align=\"center\">\n  <a href=\"https://sponsors.pi0.io/\">\n    <img src=\"https://sponsors.pi0.io/sponsors.svg?xyz\">\n  </a>\n</p>\n\n## Credits\n\nAPI-compatible with [node-pty](https://github.com/microsoft/node-pty). Terminal API inspired by [Bun](https://bun.sh/docs/runtime/child-process#terminal-pty-support).\n\n## License\n\nMIT\n","readmeFilename":"README.md"}