Skip to content

Terminal

Magia includes a full PTY (pseudo-terminal) terminal embedded in the application window. It is powered by xterm.js and talks to a native PTY process spawned by the Rust backend.

The terminal gives you a real interactive shell inside the same window as your editor and chat panels. It shares the same working directory as the active session’s project, so you can run tests, build tools, and git commands without leaving Magia.

The terminal uses the WebGL addon for hardware-accelerated rendering when available. If the WebGL context is not available (e.g., a low-power GPU or a VM), it falls back to the canvas renderer automatically — you do not need to configure anything.

A debounced viewport refresh fires 80 ms after PTY output stops. This cleans up stray characters that TUI applications (including Claude Code’s Ink renderer) can leave behind during fast redraws.

Press Cmd+\`` (backtick, macOS) or Ctrl+“ (Windows / Linux) to toggle the bottom terminal panel open and closed. You can also open the terminal from the View menu or by clicking the terminal icon in the status bar.

The terminal panel is collapsible. When open, it renders below the editor pane and can be resized by dragging the divider.

By default Magia spawns zsh. You can override this in Settings → Terminal → Shell by specifying an absolute path to any shell executable, for example /bin/bash or /usr/local/bin/fish. Set the value to empty to revert to the default.

The terminal theme is derived from Magia’s current CSS design tokens at startup and whenever the application theme changes. The colors include:

  • Background and foreground from --background / --foreground
  • Cursor color from --primary
  • Selection colors from --accent / --accent-foreground
  • ANSI colors are hardcoded for consistent CLI output readability across themes

All terminal settings are found in Settings → Terminal.

SettingDefaultDescription
terminalShellnull (system default)Absolute path to the shell binary. null uses the user’s login shell.
terminalFontFamilyJetBrains MonoFont family for terminal text. Falls back to monospace.
terminalFontSize13Font size in pixels.
terminalLineHeight1.0Line height multiplier.
terminalCursorStylebarCursor shape. One of block, bar, or underline.
terminalCursorBlinktrueWhether the cursor blinks.

All settings take effect immediately without restarting the terminal session. Font and size changes trigger a re-fit so the column/row count is recalculated correctly for the new cell dimensions.

You can open additional terminal tabs from the terminal panel header. Each tab runs an independent PTY process. Closing a tab sends SIGKILL to the associated process and frees the PTY file descriptor.

The terminal automatically resizes to fill its container. A ResizeObserver watches the container element and sends a SIGWINCH signal to the PTY process only when the column or row count actually changes, avoiding spurious resize events.