Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Jan 22, 2026

Summary

Simplifies terminal UX to a single integrated RightSidebar path, adds inline error handling for failed terminal opens, and stabilizes the terminal keybind handler to avoid re-registering global listeners during streaming updates.

Background

The "New terminal" button could fail silently when the sidebar wasn’t mounted or the API was unavailable. At the same time, we wanted to remove the popout/native terminal surfaces to reduce complexity and keep terminal behavior consistent.

Implementation

  • Removed popout/native terminal code paths (window manager, native terminal spawning, command palette entries, popout UI).
  • Standardized terminal-open results to surface errors in the header UI.
  • Passed onOpenTerminal directly into keybinds to keep listener registration stable.

Validation

  • make typecheck
  • make static-check

Risks

  • Users lose popout/native terminal options (intentional simplification). Integrated terminals remain the only supported path.

Generated with mux • Model: openai:gpt-5.2-codex • Thinking: xhigh • Cost: $11.21

The 'New terminal' button in WorkspaceHeader silently failed when:
1. addTerminalRef.current was null (RightSidebar not mounted)
2. api was null (not connected to server)

Now returns { success, error } from all terminal-opening paths and
displays the error inline in the header (same pattern as editor errors),
auto-dismissing after 3 seconds.
@github-actions github-actions bot added the bug label Jan 22, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf9d563465

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

chatInputAPI,
jumpToBottom,
handleOpenTerminal: onOpenTerminal,
handleOpenTerminal: () => void onOpenTerminal(),

Choose a reason for hiding this comment

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

P2 Badge Pass a stable terminal handler to avoid re-registering keybinds

This inline wrapper creates a new handleOpenTerminal function on every render. useAIViewKeybinds installs global window keydown listeners in an effect that depends on handleOpenTerminal, so this change forces teardown/re‑add of those listeners on every ChatPane re-render (which is frequent during streaming). That can introduce unnecessary work and makes keybind handling more fragile under heavy updates. Since onOpenTerminal already accepts optional args, it can be passed directly (or otherwise stabilized) to keep the keybind effect stable.

Useful? React with 👍 / 👎.

Terminal functionality is now exclusively provided through integrated
terminals in the RightSidebar. Removed code paths:

Frontend:
- useOpenTerminal hook (no longer needed)
- terminal-window.tsx popup entry point
- terminal.html popup window HTML
- openTerminalPopout utility function
- Command palette "New Terminal Window" commands
- Pop-out button from terminal tabs
- Mobile-only popout fallback logic in WorkspaceShell/Header

Backend:
- terminal.openWindow and terminal.closeWindow API endpoints
- terminal.openNative API endpoint (spawned native terminals)
- terminalWindowManager.ts (Electron BrowserWindow manager)
- setTerminalWindowManager wiring in ServiceContainer and main.ts
- All native terminal spawning code (macOS, Windows, Linux)

Tests:
- Removed openNative test suite (~300 lines)
- Removed openWindow test case
- Updated mocks in storybook and integration tests

vite.config.ts:
- Removed terminal.html from build entries

This simplifies the codebase significantly: one terminal path instead
of three (integrated, popout, native).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant