Zum Inhalt springen

Attached Terminals (SwiftTerm)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

The app can run a real terminal inside a project’s context and attach to it in a window. Under the hood these are ordinary tmux sessions managed by the CLI, so they keep running even when you quit the app.

An attached shell session in the MultiDocker window: the sidebar shows the project expanded to its AI sessions, and the terminal runs in the project directory with the tmux status bar at the bottom.

A session is a named tmux session, created by engine/terminal.sh and recorded in the registry under .projects[<name>].sessions[]. Each session runs one of several tools:

Tool What it starts
claude Claude Code, in the project directory
copilot GitHub Copilot CLI
shell a plain shell in the project
exec a docker compose exec shell into a running service

Sessions are named mdocker__<project>__<id>, so they’re easy to find in tmux.

In the app, expand a project in the sidebar (or use its Sessions card) and pick “new session”. You choose the tool and, for exec, the target service and shell. The equivalent CLI is:

Terminal window
mdocker terminal new <name> --tool claude
mdocker terminal exec <name> shop # shell into the "shop" service
mdocker terminal list <name>
mdocker terminal kill <name> <session-id>

The AI tools start in the project’s ai_session_path if one is configured (otherwise the project root).

The app embeds the terminal with SwiftTerm — a native terminal emulator. TerminalView wraps SwiftTerm’s LocalProcessTerminalView and runs tmux attach -t =<name> with mouse support enabled, so you get a fully interactive terminal right inside the app window.

AI tool sessions can run in a sandbox mode (--sandbox / --no-sandbox), recorded per session in the registry. Use it to constrain what an AI agent can touch while it works in your project.

Sessions are tracked in the registry, so dead ones can accumulate if a tmux server is restarted. mdocker terminal prune <name> drops registry entries whose tmux session no longer exists, keeping the list honest.