Skip to content

Add embedded terminal tabs - #624

Open
ph10w wants to merge 5 commits into
derceg:masterfrom
ph10w:codex/embedded-terminal-tab
Open

Add embedded terminal tabs#624
ph10w wants to merge 5 commits into
derceg:masterfrom
ph10w:codex/embedded-terminal-tab

Conversation

@ph10w

@ph10w ph10w commented Jul 28, 2026

Copy link
Copy Markdown

Overview

The standard Open Command Prompt action now opens cmd.exe in an Explorer++ tab. Elevated terminals remain external, with the existing command prompt used as a fallback when the embedded terminal is unavailable. Activating .bat or .cmd files opens a temporary terminal tab that closes when the script finishes.

Architecture

  • Embeds Microsoft's HwndTerminal control and connects it to cmd.exe through ConPTY.
  • Keeps terminal creation, process hosting, launch routing, message handling, clipboard access, and output parsing in focused terminal classes, minimizing changes to existing Explorer++ components.
  • Loads the pinned Microsoft.Terminal.Control.dll dynamically from the application directory and includes it in portable and MSI packages with attribution.
  • Defers ConPTY startup until the tab is visible and marshals terminal output to the UI thread, preserving the initial prompt when a terminal is reopened after exit.

Behavior

  • Starts in the active folder, tracks cd changes in the tab title and tooltip, and closes interactive tabs when their command process exits.
  • Supports terminal text copy and paste with surrounding control/whitespace cleanup, while preserving normal Explorer++ shortcuts outside terminal tabs.
  • Provides Tab completion, Ctrl+Tab tab switching, scrollback with scrollbar and mouse wheel, Explorer++ font-size updates with Cascadia Mono, and a dedicated multi-size command-line icon.
  • Integrates terminal content with tab focus, layout, taskbar previews, and safe initialization failure handling.

Checks performed

  • Built Explorer++ and TestExplorer++ in Release|x64 with 0 warnings and 0 errors.
  • Passed all 795 tests, including terminal clipboard/output parsing and locale-aware formatting coverage.
  • Repeatedly verified open → exit → reopen, confirming that the path prompt appears immediately and remains usable.
  • Verified interactive terminals, automatic batch execution/closure, and MSI XML/DLL paths. A local MSI build was not possible because WiX Toolset 3.11 is not installed.

@ph10w
ph10w marked this pull request as ready for review July 29, 2026 09:00
ph10w and others added 4 commits July 29, 2026 11:54
Close temporary batch terminal tabs after script execution, split terminal responsibilities into focused classes, add terminal unit coverage, and make size-formatting tests locale-aware.
@derceg

derceg commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Hi ph10w, this looks like a more significant change, so I appreciate the work you've put into it. I think it needs some justification, though. Is there a particular reason why running a terminal embedded in a tab is better than running it externally? Also, is Microsoft.Terminal.Control.dll designed to be used as a sort of public API in this way?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants