Integrated terminal: run shells inside MandoCode Desktop - #9
Merged
Conversation
A sliding terminal panel with real, fully-interactive shells, embedded in the desktop app the way Visual Studio / VS Code host terminals. - Toggles from a bottom rail icon or Ctrl+` (Ctrl+Shift+` = new shell tab) - Slides up from the bottom, pushing the chat + prompt up; drag the top edge (↕ cursor) to resize, or maximize to ~95% and restore - Tabbed shells, auto-detecting what's installed (PowerShell 7, Windows PowerShell, cmd, Git Bash, WSL); each opens in the active agent's folder - Real terminal fidelity via Windows ConPTY + xterm.js in a WebView2: colors, cursor movement, and interactive TUIs (vim, git, progress bars) Implementation notes: - Zero new NuGet dependencies. ConPTY is hand-written P/Invoke (Services/PseudoConsole.cs); xterm.js is bundled locally under Assets/web/terminal and served offline via the existing virtual-host mapping, matching the app's offline-first design. - The panel (and its WebView2/shells) is created lazily on first open, and every shell is torn down on window close so no ConPTY processes leak. - Ctrl+` is handled in Root_KeyDown, not a KeyboardAccelerator, and the splitter cursor is set on Loaded, not in a ctor: both avoid a native WinUI fast-fail (STATUS_STOWED_EXCEPTION) on OEM keys / early ProtectedCursor. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a built-in terminal to MandoCode Desktop, so developers can run real shell commands (PowerShell, cmd, Git Bash, etc.) without leaving the app — the same way Visual Studio and VS Code let you pop open a terminal alongside your work.
Why this matters
Today, a user working with the AI agent has to alt-tab to a separate terminal window to run builds, git commands, or scripts. That context-switch is friction. Bringing the terminal into the app keeps the whole "chat with the agent → run a command → see the result" loop in one place, which is a core expectation for any serious developer tool.
What the user gets
** (the same shortcut VS Code uses). **Ctrl+Shift+opens an additional shell.vimor interactivegit) all work correctly, because it's built on the same underlying technology the Windows Terminal and VS Code use.Scope / what's NOT in this change
Cost & risk notes (for planning)
How it was validated
Reviewer notes
xterm.*files underAssets/web/terminal/are the third-party library (expected to be large/minified); the reviewable app code is inControls/,Services/, andMainWindow.*.