Skip to content

App Shell Command Surface

MainWindowViewModel is the public command and state boundary for the reusable app shell. The view model is intentionally broad because it backs both the native menu surface and the in-window terminal shell.

Hosts normally use MainWindow and let the shell bind everything. Custom hosts that embed MainView directly can bind to the same commands and interactions.

Public Option Models

TypePurpose
TransportModeOptionTransport selector entry for PTY, pipe, raw TCP, Telnet, serial, and SSH.
ShellProfileOptionDiscovered local shell profile entry.
SessionLaunchOptionRunnable profile shown by launch/search UI.
TerminalCaptureFormatOptionCapture save format entry.
SettingsCategoryOptionSettings category selector entry and stable category ids.
SshAuthModeOptionSSH authentication mode selector entry and stable auth ids.
TerminalThemeApplyRequestTheme payload sent through the theme-apply interaction.
TerminalShaderSampleOptionShader sample entry exposed by the app shell.

These types are lightweight view-model records. Durable profile, workspace, theme, capture, and transport documents still live in the lower terminal packages.

Command Groups

The reusable shell groups commands by workflow:

GroupExamples
TabsNewTabCommand, CloseCurrentTabCommand, ActivateTabCommand, CycleTabForwardCommand, CycleTabBackwardCommand
Clipboard and selectionCopySelectionCommand, PasteClipboardCommand, SelectAllCommand
SearchApplySearchCommand, NextSearchCommand, PreviousSearchCommand, ClearSearchCommand
SessionsRefreshSessionLauncherCommand, LaunchSessionProfileCommand, RestartActiveSessionCommand, ClearActiveScrollbackCommand
PanesSplitPaneRightCommand, SplitPaneDownCommand, focus-pane commands, resize-pane commands
Capture and replayToggleCaptureCommand, SaveCaptureCommand, LoadReplayCommand, ReplayPlayPauseCommand, StopReplayCommand
SettingsPrepareSettingsPanelCommand, profile CRUD commands, ApplySettingsPanelCommand, SaveSettingsPanelCommand
View stateleft panel, search panel, status bar, diagnostics, tabs-in-titlebar, shader, theme, and font commands
ApplicationShowAboutCommand, QuitApplicationCommand

The native menu and fallback menu bar bind to the same commands, so menu state and in-window UI state stay aligned.

ReactiveUI Interactions

MainWindowViewModel uses ReactiveUI interactions for operations that need window, storage, or terminal-control services. MainWindowController registers the default handlers.

Important interaction groups:

InteractionHost responsibility
Tab interactionsCreate, activate, close, and cycle tabs.
Clipboard interactionsCopy, paste, and select all in the active terminal.
Search interactionsApply, navigate, and clear active terminal search.
Capture interactionsStart/stop capture, save capture, load replay, control replay playback.
Session interactionsRefresh launch profiles, launch selected profiles, restart or clear the active session.
Pane interactionsSplit, focus, and resize the active pane.
Settings interactionsPrepare/apply/save profile settings and browse font or log paths.
Dialog/application interactionsShow about dialog and quit the host application.

When you use MainWindow, these handlers are already installed. If you host MainView yourself, provide equivalent handlers or reuse the window-level shell.

Visibility State

The shell exposes public state for the view features that can also be toggled from native menus:

  • left panel visibility;
  • titlebar search panel visibility;
  • status bar visibility;
  • tabs in titlebar;
  • diagnostics panel visibility;
  • command history overlay;
  • settings panel visibility.

This is why the View menu can offer the same feature set as the visible UI.

Theme And Shader Commands

Theme and shader selection are shell-level features over lower-level rendering models:

  • TerminalThemeApplyRequest carries a TerminalTheme plus display name.
  • TerminalShaderSampleOption carries a stable shader sample id and display name.
  • ApplyThemeModelInteraction applies a concrete terminal theme.
  • ApplyShaderSampleInteraction applies the selected shader sample to the active terminal surface.

Use the lower-level shader articles when you need to provide your own shader source:

MIT Licensed