Skip to content

Conversation

@unitythemaker
Copy link

@unitythemaker unitythemaker commented Jan 20, 2026

Summary

  • Terminal focus fix - Keyboard input now goes to terminal instead of chat (focuses ghostty's internal textarea)
  • Terminal rename - Double-click tab or right-click → Rename (with overlay input approach)
  • Terminal error state - Shows dismissable "Connection Lost" message when connection fails
  • CSP update - Added wasm-unsafe-eval to script-src and data: to connect-src for ghostty WASM
  • OPENCODE_TERMINAL=1 env var - Added for PTY sessions to detect opencode terminal context
  • Terminal navigation - Added next() and previous() methods to terminal context

Issues Fixed

Files Changed

  • packages/app/src/components/session/session-sortable-terminal-tab.tsx - Rename functionality
  • packages/app/src/components/terminal.tsx - Simplified WebSocket close handling
  • packages/app/src/context/terminal.tsx - Added error field, improved close() logic, navigation
  • packages/app/src/pages/session.tsx - Terminal focus effect, error UI, disabled chat autofocus
  • packages/opencode/src/pty/index.ts - Added OPENCODE_TERMINAL=1 env var
  • packages/opencode/src/server/server.ts - Updated CSP for WASM

Testing

Tested manually with bun dev for both backend and frontend.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found 2 potentially related PRs that address similar issues:

  1. PR fix(server): allow WASM loading in CSP for ghostty-web terminal #9451 - fix(server): allow WASM loading in CSP for ghostty-web terminal

  2. PR fix(app): load ghostty wasm via asset url #9186 - fix(app): load ghostty wasm via asset url

These appear to be related to the CSP/WASM aspect of your PR. Check if these have already been merged or are still open, as your PR might supersede or complement them.

@adamdotdevin
Copy link
Contributor

@unitythemaker could you share some gifs/screenshots?

@unitythemaker
Copy link
Author

unitythemaker commented Jan 21, 2026

@adamdotdevin
Copy link
Contributor

@unitythemaker please rebase and resolve conflicts and I'll get this merged!

@unitythemaker
Copy link
Author

@unitythemaker please rebase and resolve conflicts and I'll get this merged!

Sure!

… state

- Close terminal tabs automatically when shell exits
- Fix freeze when closing middle tabs
- Auto-close terminal panel when last tab is closed
- Fix keyboard focus going to terminal instead of chat
- Add terminal error state UI showing 'Connection Lost' message
- Add terminal rename via double-click or context menu
- Add OPENCODE_TERMINAL=1 env var for PTY sessions
- Update CSP to allow wasm-unsafe-eval for ghostty terminal
@unitythemaker
Copy link
Author

Conflicts resolved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants