Skip to content

fix(app): terminal rework#14217

Merged
adamdotdevin merged 3 commits intodevfrom
opencode/stellar-meadow
Feb 19, 2026
Merged

fix(app): terminal rework#14217
adamdotdevin merged 3 commits intodevfrom
opencode/stellar-meadow

Conversation

@adamdotdevin
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 19, 2026 12:25
@adamdotdevin adamdotdevin force-pushed the opencode/stellar-meadow branch from 7e59f6c to efe1b41 Compare February 19, 2026 12:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the terminal implementation to improve WebSocket connection handling, fix focus management bugs, and optimize rendering performance. The changes upgrade ghostty-web from 0.3.0 to 0.4.0 (removing the need for a patch), redesign PTY socket tracking using WeakMaps instead of Bun-specific ws.data objects, and implement a DOM mounting optimization that keeps the terminal mounted after first open.

Changes:

  • Upgraded ghostty-web to 0.4.0 and removed associated patch for Unicode codepoint validation
  • Redesigned PTY WebSocket tracking to use WeakMaps with unique socket IDs instead of relying on ws.data
  • Optimized terminal panel rendering to keep DOM mounted after first open (hidden with display:none when closed)
  • Fixed focus management bug in terminal-panel.tsx (line 95: opened()open())
  • Improved WebSocket lifecycle management with closing flag to prevent race conditions during cleanup

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
patches/ghostty-web@0.3.0.patch Removed patch file as Unicode validation is now handled in upstream v0.4.0
packages/opencode/test/pty/pty-output-isolation.test.ts Removed ws.data references and obsolete test for Bun-specific recycling scenario
packages/opencode/src/server/routes/pty.ts Simplified Socket type and validation by removing ws.data dependency
packages/opencode/src/pty/index.ts Implemented WeakMap-based socket tracking with unique IDs for robust connection isolation
packages/app/src/pages/session/terminal-panel.tsx Added rendering optimization with everOpened state and fixed focus management logic
packages/app/src/components/terminal.tsx Improved write operations with promises and added closing flag for safer cleanup

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adamdotdevin adamdotdevin merged commit d07f099 into dev Feb 19, 2026
14 checks passed
@adamdotdevin adamdotdevin deleted the opencode/stellar-meadow branch February 19, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments