-
Notifications
You must be signed in to change notification settings - Fork 58
feat: external and TMUX Terminal Provider Support #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This looks an awesome and useful feature. I personally would prefer using a tmux terminal over the neovim terminal. Do you know what's required for this to be merged in? |
Thanks for your PR! I tried to use the feature directly from your branch and have one suggestion. |
This looks great, hoping for it to merge soon! |
Good catch! I have removed the noisy logs. Thanks! |
Hey @gaborkajtar, thanks for opening this PR. Observing this and other PRs and issues, adding a terminal provider that results in noops makes sense. I prefer to name such a provider Regarding the tmux provider, while I am personally a tmux user, I prefer not to incorporate this provider into the main codebase. There are several reasons for this.
Though I see the advantage of using "real" terminals and panes instead of neovim terminal buffers, I prefer not to completely dismiss this provider. Instead, please refactor it into a custom terminal provider, so we can update the readme to include this tmux provider as a custom option in a collapsible. This would be easy to copy and paste, and anyone using the tmux provider would understand that A) this provider comes with no guarantees regarding maintenance, and B) any interactions performed by the custom tmux provider are transparent to the user. |
External and TMUX Terminal Provider Support
This PR introduces two new terminal providers, expanding claudecode.nvim's flexibility for different development environments.
🚀 New Features
1. External Terminal Provider
What: Added a no-op terminal provider for users who prefer running Claude Code in external terminals.
Key capabilities:
event = "VeryLazy"
, starts MCP server automaticallyUse cases:
Configuration:
2. Tmux Terminal Provider
What: Added native tmux integration that creates and manages tmux panes for Claude Code sessions.
Key capabilities:
Technical details:
tmux split-window
with calculated dimensionssplit_side
("left"/"right") andsplit_width_percentage
(0.0-1.0)Configuration:
🔧 Technical Implementation
Provider Architecture
Both providers implement the standardized
TerminalProvider
interface:setup()
,open()
,close()
,toggle()
functionsis_available()
capability detectionget_active_bufnr()
for buffer managementIntegration Changes
init.lua
): Enhanced@mention
handling to skip terminal visibility checks for external providerterminal.lua
): Added provider validation and selection logicTesting
tmux_terminal_provider_spec.lua
)🎯 Provider Selection Logic
The
provider = "auto"
setting now follows this priority:folke/snacks.nvim
is available💡 Use Case Examples
Tmux Users:
External Terminal Workflows:
🧪 Testing Coverage