首页/ AI 技能 / @skilllib/skill-2117939930272417681
Skill站外收录 @skilllib/skill-2117939930272417681

tabz-development

面向 TabzChrome 终端功能的开发与调试,涵盖 xterm.js 渲染、WebSocket 通信、PTY 进程管理、窗口尺寸同步及 tmux 集成等核心环节,为终端组件与后端服务的协同实现提供完整参考模式。

0.0 (0) 27 次安装 原作者 编程导航
收录于 2026-01-22
效率工具 AI 技能

Skills.MD

# TabzChrome Development Reference patterns for building TabzChrome's terminal implementation. ## Core Architecture ``` extension/components/Terminal.tsx → WebSocket → backend/modules/pty-handler.js ↓ ↓ xterm.js render tmux session ``` ## Key Files | File | Purpose | |------|---------| | `extension/components/Terminal.tsx` | xterm.js terminal + resize | | `extension/hooks/useTerminalSessions.ts` | Session lifecycle | | `extension/background/websocket.ts` | WebSocket management | | `backend/modules/pty-handler.js` | PTY spawning, tmux | ## Quick Patterns ### Terminal Initialization ```typescript const term = new Terminal({ /* options */ }); const fitAddon = new FitAddon(); term.loadAddon(fitAddon); term.open(containerRef.current); fitAddon.fit(); ``` ### Resize Handling ```typescript // Debounce resize, sync xterm → PTY fitAddon.fit(); ws.send(JSON.stringify({ type: 'resize', cols: term.cols, rows: term.rows })); ``` ### WebSocket I/O ```typescript // Terminal → Backend term.onData(data => ws.send(JSON.stringify({ type: 'input', data }))); // Backend → Terminal ws.onmessage = (e) => term.write(JSON.parse(e.data).data); ``` ## References See `references/` for detailed patterns: - `xterm-patterns.md` - Terminal setup, addons, options - `resize-handling.md` - Debouncing, PTY sync - `websocket-io.md` - Message protocol, reconnection - `testing-checklist.md` - Manual test scenarios

评论 0

还没有评论,来抢沙发。