tauri-pty

Integrate PTY backends with xterm.js rendering in Tauri 2 apps.

7|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/yofabr/tauri-pty --skill tauri-pty
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tauri-pty
Source: https://github.com/yofabr/tauri-pty/tree/main
Command: npx skills add https://github.com/yofabr/tauri-pty --skill tauri-pty

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill removes the friction of creating a reliable terminal emulator in a Tauri 2 desktop app by guiding end-to-end PTY integration with a React UI and xterm.js rendering.

Core Features & Use Cases

  • Vertical stack setup: Rust backend PTY integration (via tauri-plugin-pty or manual portable_pty) plus React/TypeScript frontend wiring.
  • Interactive terminal experience: Stream PTY output to xterm.js, forward user keystrokes back to the shell, and keep terminal dimensions synchronized on resize.
  • Production-ready UI patterns: Multi-tab terminal management, correct mount/unmount behavior to avoid killing sessions, and performance/safety best practices (TERM/COLORTERM, cleanup, WebGL handling, throughput considerations).

Quick Start

Use the tauri-pty skill to embed an xterm.js terminal in your Tauri 2 + React app that spawns your user’s shell and supports correct resizing and tab switching.

Frequently Asked Questions about tauri-pty

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

FAQPage Schema
How do I build a terminal emulator in Tauri 2 with xterm.js and PTY?

To build a terminal emulator in Tauri 2, you integrate a Rust PTY backend with xterm.js rendering and React wiring, enabling interactive shell spawning, output streaming, and keyboard input forwarding.

How do I manage multi-tab terminal sessions in a React Tauri app without killing the shell?

Managing multi-tab terminal sessions requires correct mount and unmount behavior with deterministic cleanup to prevent session loss, ensuring PTY streams remain alive during tab switching.

What causes broken text wrapping when resizing xterm.js in a Tauri application?

Broken text wrapping during resize is caused by failing to synchronize terminal dimensions between xterm.js and the PTY backend, requiring explicit dimension synchronization on every resize event.

Can I use portable_pty to set up a PTY backend in Tauri 2?

Yes, you can use portable_pty to manually set up the PTY backend in Tauri 2, or use the dedicated tauri-plugin-pty, both requiring correct environment variables for proper shell interaction.

What environment variables and renderer settings are needed for xterm.js PTY streaming?

Reliable PTY streaming requires setting TERM and COLORTERM environment variables, applying WebGL handling for renderer performance, and following the correct renderer initialization order.