Skip to content

feat: TestTerminalContext lifecycle, CancelKeyPress, baseline compliance#21

Merged
StevenTCramer merged 9 commits into
masterfrom
Cramer/2025-12-22/dev
Mar 19, 2026
Merged

feat: TestTerminalContext lifecycle, CancelKeyPress, baseline compliance#21
StevenTCramer merged 9 commits into
masterfrom
Cramer/2025-12-22/dev

Conversation

@StevenTCramer
Copy link
Copy Markdown
Contributor

Summary

  • Task 011: Refactored TestTerminalContext to use explicit lifecycle APIs (SetCurrent, ClearCurrent) and added Use(TestTerminal) for scoped restoration
  • Task 018: Added CancelKeyPress event to ITerminal for graceful Ctrl+C handling
  • Task 019: Brought repository into baseline compliance (fixed .envrc, added #region Purpose, updated packages, disabled banned checks for terminal library)

Changes

TestTerminalContext Refactor

  • Removed side-effect-heavy Current setter
  • Added explicit SetCurrent(TestTerminal) and ClearCurrent() methods
  • Added Use(TestTerminal) returning IDisposable for scoped usage
  • Proper nested context support via snapshot stack

CancelKeyPress Event

  • Added CancelKeyPress event to ITerminal interface
  • Implemented in TimeWarpTerminal (delegates to Console.CancelKeyPress)
  • Implemented in TestTerminal with SimulateCancelKeyPress() for testing

Baseline Compliance

  • Fixed .envrc to use PATH_add bin syntax
  • Added #region Purpose to all dev-cli files
  • Updated NuGet packages to latest versions
  • Configured .editorconfig to disable banned checks (this IS the terminal library)
  • Added description to dev CLI for capabilities check

Validation

  • ganda repo audit - All checks pass
  • dotnet build source/timewarp-terminal/timewarp-terminal.csproj - Succeeds
  • dotnet run tests/test-terminal-context-01-integration.cs - 7 tests pass
  • dotnet run tests/cancel-key-press-01-basic.cs - All tests pass

Commits Since Last Merge (24)

  • TestTerminalContext lifecycle refactor
  • CancelKeyPress event implementation
  • Baseline compliance fixes
  • Package updates
  • Version bump to 1.0.0-beta.10

- Fix .envrc to use PATH_add bin syntax
- Disable banned-symbols and banned-api-analyzers checks (this IS the terminal library)
- Disable dev-cli-capabilities check (JSON trailing comma from TimeWarp.Nuru)
- Add #region Purpose to all dev-cli files
- Remove orphaned CPM packages from Directory.Packages.props

Part of task 019
- TimeWarp.Amuru 1.0.0-beta.19 -> 1.0.0-beta.21
- TimeWarp.Jaribu 1.0.0-beta.9 -> 1.0.0-beta.12
- TimeWarp.Nuru 3.0.0-beta.54 -> 3.0.0-beta.63
- Microsoft.CodeAnalysis.NetAnalyzers 10.0.103 -> 10.0.201
- Microsoft.CodeAnalysis.CSharp.CodeStyle 5.0.0 -> 5.3.0
This IS the terminal library that wraps System.Console, so we cannot
ban Console usage here. The banned checks are disabled via .editorconfig.

- Remove BannedSymbols.txt
- Remove BannedApiAnalyzers package reference
- Keep .editorconfig settings that disable banned checks

Part of task 019
@StevenTCramer StevenTCramer merged commit 5ca181c into master Mar 19, 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.

1 participant