Skip to content

feat: add support for out-of-tree terminal providers#91

Merged
ThomasK33 merged 1 commit intomainfrom
thomask33/feat_add_support_for_custom_terminal_providers
Jul 29, 2025
Merged

feat: add support for out-of-tree terminal providers#91
ThomasK33 merged 1 commit intomainfrom
thomask33/feat_add_support_for_custom_terminal_providers

Conversation

@ThomasK33
Copy link
Member

@ThomasK33 ThomasK33 commented Jul 29, 2025

Add support for out-of-tree terminal providers

This PR allows creating custom terminal providers for claudecode.nvim by passing a table with required functions instead of using the built-in providers. This enables integration with any terminal plugin.

Key changes:

  • Added validation and enhancement of custom provider tables
  • Implemented graceful fallback to native provider if custom provider is invalid or unavailable
  • Added auto-generation of optional functions for custom providers
  • Updated documentation with detailed examples of creating custom providers
  • Added comprehensive tests for custom provider functionality

The terminal provider configuration now accepts a table with required functions:

  • setup: Initialize the terminal provider
  • open: Open terminal with command and environment
  • close: Close the terminal
  • simple_toggle: Simple show/hide toggle
  • focus_toggle: Smart toggle (focus if not focused, hide if focused)
  • get_active_bufnr: Return terminal buffer number
  • is_available: Check if the provider can be used

Optional functions are auto-generated if not provided:

  • toggle: Defaults to calling simple_toggle for backward compatibility
  • _get_terminal_for_test: For testing purposes

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ThomasK33 ThomasK33 marked this pull request as ready for review July 29, 2025 13:57
Change-Id: I2f559e355aa6036ca94b8aca13d53739c6b5e021
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33 ThomasK33 force-pushed the thomask33/feat_add_support_for_custom_terminal_providers branch from 40e19d5 to 5b10521 Compare July 29, 2025 14:32
@ThomasK33 ThomasK33 changed the title feat: add support for custom terminal providers feat: add support for out-of-tree terminal providers Jul 29, 2025
@ThomasK33 ThomasK33 merged commit 5d7ab85 into main Jul 29, 2025
4 checks passed
@ThomasK33 ThomasK33 deleted the thomask33/feat_add_support_for_custom_terminal_providers branch July 29, 2025 15:02
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