[FEATURE] Expose terminal variable
- Ngôn ngữ chính
- Lua
- Star
- 3.1k
- Fork
- 216
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
## 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).
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu bằng việc lần theo nơi ClaudeCode tạo và lưu terminal, bao gồm module claudecode.terminal được tham chiếu trong issue, rồi so sánh với các điểm vào hiện có của user-command. Hoàn thành nghĩa là một accessor công khai trả về terminal đã được tạo để sử dụng theo chương trình mà không tạo terminal thứ hai; hãy xác minh rằng hành vi của terminal hiện có vẫn không thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- lua
- Lĩnh vực
- tooling
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 62/100