portable_pty

Manage pseudo-terminal creation and control for shell processes across macOS, Linux, and Windows.

28|6|Updated Dec 27, 2025
One-click install
npx skills add https://github.com/johnlindquist/script-kit-next --skill portable-pty
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: portable_pty
Source: https://github.com/johnlindquist/script-kit-next/tree/main/.opencode/skill/portable-pty
Command: npx skills add https://github.com/johnlindquist/script-kit-next --skill portable-pty

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a robust and cross-platform solution for managing pseudo-terminals (PTYs), enabling the seamless spawning and control of shell processes across different operating systems.

Core Features & Use Cases

  • Cross-Platform Compatibility: Works on macOS, Linux, and Windows.
  • Process Spawning: Easily launch shell commands with custom environments and working directories.
  • I/O Handling: Manages input to and output from spawned processes, with support for both blocking and non-blocking I/O patterns.
  • Resize Handling: Allows dynamic resizing of the terminal dimensions, triggering SIGWINCH signals to the child process.
  • Process Lifecycle Management: Provides methods to check if a process is running, wait for its completion, or forcefully kill it.
  • Use Case: Integrate a terminal emulator within an application, allowing users to run shell commands directly, or automate complex command-line workflows.

Quick Start

Use the portable_pty skill to spawn a bash shell with a specific working directory and environment variables.

Frequently Asked Questions about portable_pty

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage pseudo-terminal creation and control across different operating systems?

Pseudo-terminal management across macOS, Linux, and Windows is handled by spawning shell processes with custom environments and working directories, enabling seamless interactive terminal sessions regardless of the underlying OS.

How do I spawn a shell process with custom environment variables and a specific working directory?

Spawning a shell process with custom environment variables and working directories is achieved by launching shell commands through the PTY interface, which manages the process lifecycle and I/O streams for the spawned session.

Does cross-platform PTY management support dynamic terminal resizing and SIGWINCH signals?

Cross-platform PTY management supports dynamic terminal resizing by adjusting terminal dimensions, which triggers SIGWINCH signals to the child process to ensure proper layout updates during interactive sessions.

What is the best way to handle real-time I/O redirection for interactive terminal sessions?

Real-time I/O redirection for interactive terminal sessions is handled by managing input to and output from spawned processes, supporting both blocking and non-blocking I/O patterns for automated command execution.

Can I forcefully kill or wait for the completion of a spawned shell process?

Process lifecycle management provides methods to check if a process is running, wait for its completion, or forcefully kill it, ensuring full control over spawned shell processes during execution.