Skip to content

feat(term): add configurable test terminal - #307

Closed
efegokdemir wants to merge 1 commit into
cli:trunkfrom
efegokdemir:codex/issue-191-test-terminal
Closed

efegokdemir wants to merge 1 commit into
cli:trunkfrom
efegokdemir:codex/issue-191-test-terminal

Conversation

@efegokdemir

Copy link
Copy Markdown

Summary

Closes #191.

Add a reusable, configurable terminal double so extension authors can test code that depends on terminal streams and capabilities without implementing their own fake.

Changes

  • Add the exported term.Terminal interface implemented by production Term values and TestTerminal.
  • Add configurable TestTerminal streams, TTY/color capabilities, dimensions, size errors, and theme.
  • Keep the zero value safe for non-interactive tests and cover configured and zero-value behavior.

Testing

  • go test ./pkg/term - passed
  • go test ./... - passed
  • go vet ./... - passed
  • git diff --check - passed

Notes

No competing open PR was found for #191. AI assistance was used to prepare this change; the submitting author reviewed the complete diff and validation results.

Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
@BagToad BagToad closed this Sep 23, 2026
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.

Add a test term.Terminal implementation for extension authors to use in tests

2 participants