terminal-expert

Configure xterm.js terminals with PTY integration and session persistence in VS Code extensions.

21|11|Updated Jul 4, 2025
One-click install
npx skills add https://github.com/s-hiraoku/vscode-sidebar-terminal --skill terminal-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terminal-expert
Source: https://github.com/s-hiraoku/vscode-sidebar-terminal/tree/main/.claude/skills/terminal-expert
Command: npx skills add https://github.com/s-hiraoku/vscode-sidebar-terminal --skill terminal-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill provides comprehensive, expert-level guidance for implementing custom terminal features in VS Code extensions, unifying xterm.js details with VS Code's architecture. It simplifies complex tasks like PTY integration, performance optimization, and session persistence, saving developers extensive research and development time.

Core Features & Use Cases

  • xterm.js Setup & Addons: Configure basic terminals, enable WebGL rendering, and integrate addons like Fit and Serialize.
  • PTY Integration: Manage pseudo-terminal processes for robust shell interaction and flow control.
  • Session Persistence: Save and restore terminal scrollback content for seamless user experience.
  • Use Case: Create a custom VS Code terminal that supports GPU acceleration, persists its scrollback content across sessions, and integrates with shell commands using OSC 633 sequences for enhanced functionality.

Quick Start

Use the terminal-expert skill to set up a basic xterm.js terminal instance with the FitAddon and WebglAddon, ensuring it resizes automatically to its container.

Frequently Asked Questions about terminal-expert

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

FAQPage Schema
How do I build a custom terminal in VS Code using xterm.js?

Create a custom terminal by initializing xterm.js in a WebView, configuring the FitAddon for automatic resizing, and integrating a PTY process for shell interaction. This approach gives you full control over terminal features, rendering performance, and session persistence within VS Code extensions.

What's the best way to handle terminal input like keyboard, mouse, and IME events in a VS Code extension?

Unified input handling in xterm.js captures keyboard, mouse, and IME input through event listeners and forwards them to the PTY. This pattern ensures responsive, accessible terminal behavior across different platforms and input methods.

Can I persist terminal scrollback content across VS Code sessions?

Yes, the Serialize addon saves terminal scrollback data and session state, which you restore on terminal restart. This enables seamless user experience by preserving command history and output between extension reloads or editor restarts.

How do I optimize xterm.js rendering performance in VS Code WebViews?

Enable WebGL rendering with WebglAddon for GPU acceleration and configure appropriate buffering settings to handle fast output. This combination reduces CPU usage and ensures responsive terminal performance even with high-throughput shell commands.

Does xterm.js support shell integration features like OSC 633 sequences?

Yes, xterm.js processes OSC shell integration sequences that enable command tracking and semantic rendering. Integrating this with PTY processes allows enhanced shell functionality such as command markers and status reporting.

What do I need to know about PTY lifecycle management in VS Code terminal extensions?

PTY processes require proper spawning, flow control, and cleanup to avoid resource leaks. Managing terminal lifecycle—initialization, resize handling, and graceful shutdown—ensures stable, long-running terminal instances within your extension.