[FEATURE] Expose terminal variable
- 主要语言
- Lua
- 星标
- 3.1k
- 派生
- 216
- PR 合并指标
- 30 天内没有已合并 PR
描述
## Feature Description
When we call ClaudeCode, it creates a terminal
` local terminal_ok, terminal = pcall(require, "claudecode.terminal")`
but the only way to access it is via user commands.
Feature would be to expose it.
## Use Case
Anyone who wants to make any code interacting with claude API.
Example:
https://github.com/ilan-schemoul/nvim-config/commit/e95797a601958929acea7f60641e09a481fd39ab#diff-7a87cf1458c4f35acd87b922d094f8f80580bdbf2fee6b36dc332db086e1b289R30
User commands are not to be made for programatic interactions as the name suggests.
If I require("claudecode/terminal") it spans up another terminal if I do toggle or whatever.
## Proposed Solution
require("claude").get_terminal() (or get_terminal_interface()) would return the created terminal
## Alternatives Considered
workaround is calling user commands. It sucks, you are limited compared to API, you have no LSP helping you, it's weird and you have to escape characters sometimes (or i think you can provide with { args = txt } the text and no need to escape. but anyway it's confusing).
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先追踪 ClaudeCode 创建和存储 terminal 的位置,包括 issue 中引用的 claudecode.terminal 模块,并将其与现有的 user-command 入口进行比较。完成的标准是:一个公共 accessor 返回已创建的 terminal 供程序化使用,而不会创建第二个 terminal;验证现有 terminal 的行为保持不变。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- lua
- 领域
- tooling
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 62/100