Skip to content

feat: import Windows Terminal profiles into New Session dialog#12

Merged
AThraen merged 22 commits into
mainfrom
feat/wt-profiles
May 10, 2026
Merged

feat: import Windows Terminal profiles into New Session dialog#12
AThraen merged 22 commits into
mainfrom
feat/wt-profiles

Conversation

@AThraen
Copy link
Copy Markdown
Contributor

@AThraen AThraen commented May 8, 2026

Summary

Closes #6. Adds an opt-in setting that lets the New Session dialog read the user's Windows Terminal settings.json and offer each profile as a one-click starting point. Picking a profile pre-fills folder/command/name and stamps per-session appearance overrides — color scheme, font (family/size/weight/ligatures), cursor (shape/blink), padding, transparency, and a best-effort retro CRT overlay — onto the new ShellSession. The app chrome (sidebar, toolbar, accent stripe) keeps Catppuccin; only the inner xterm pane is restyled.

  • New WindowsTerminalProfileService probes Stable / Preview / Unpackaged install paths, flattens profiles.defaults, filters hidden profiles, resolves color schemes (with BuiltInTerminalSchemes fallback for Campbell / Vintage / One Half / Solarized / Tango).
  • Per-session overrides on ShellSession are persisted to state.json so a profile-stamped session keeps its look across restarts and stays stable even if the source profile is later edited or deleted.
  • Transparent sessions navigate to a sibling terminal-transparent.html (xterm needs allowTransparency set in the constructor); both HTML entry points share terminal-init.js. Acrylic blur is not reachable from WebView2 — we get flat alpha over the WPF chrome instead. Retro effect is a CSS scanlines overlay, not a WebGL CRT shader.

Test plan

  • 56/56 unit tests pass (dotnet test tests/CodeShellManager.Tests/)
  • Solution builds clean (dotnet build src/CodeShellManager/CodeShellManager.csproj)
  • Manual: Settings → tick "Show Windows Terminal profiles when creating sessions" → New Session dialog shows the Profile combobox populated from your WT install
  • Manual: pick a profile with a custom color scheme → terminal renders with that scheme on launch
  • Manual: pick a profile with opacity < 1.0 → terminal pane is transparent over the WPF chrome (verifies the NavigationStarting guard fix in d47c744)
  • Manual: relaunch app → profile-stamped sessions restore with the same look (overrides persisted)
  • Manual: setting off → New Session dialog has no Profile combobox at all

🤖 Generated with Claude Code

AThraen and others added 19 commits May 8, 2026 14:10
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nalProfiles setting

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds ProfilesTests with two cases: combobox absent when ImportWindowsTerminalProfiles is off (default), and the settings checkbox itself is present in the Settings window.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AThraen AThraen requested a review from martin-ottosen May 8, 2026 13:56
AThraen and others added 3 commits May 8, 2026 15:58
…ve AppSettings

The MainWindow settings-save block copies each edited field back to
_vm.Settings before SaveStateAsync. ImportWindowsTerminalProfiles was
missing from that block, so the toggle reverted on every dialog reopen.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Restore loop now launches live sessions in saved order first, then
appends dormant entries — matches the invariant SleepSession and
RebuildSidebarOrder enforce at runtime.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…line

Profiles store paths like %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe.
Win32 CreateProcess does not expand %VAR% references, so the unexpanded
path failed with ERROR_FILE_NOT_FOUND. Mirrors the existing expansion
of startingDirectory.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AThraen AThraen merged commit 2ab6921 into main May 10, 2026
1 check passed
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.

Support for Terminal Profiles

1 participant