Skip to content

Commit 2d5c33c

Browse files
committed
Remove ai-code--claude-code-send-command-impl and update backends to
use claude-code--do-send-command directly
1 parent 29da5cb commit 2d5c33c

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33
GTAGS
44
GRTAGS
55
GPATH
6+
.ai.code.prompt.org
7+
.projectile
8+
GTAGS
9+
GRTAGS
10+
GPATH

ai-code-backends.el

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,6 @@
2727
(interactive "P")
2828
(ai-code--unsupported-resume arg))
2929

30-
(defun ai-code--claude-code-send-command-impl (cmd)
31-
"Send CMD to claude-code terminal backend programmatically.
32-
This function bypasses the interactive prompt in `claude-code-send-command'
33-
and directly sends the command to the terminal. It first attempts to use
34-
`claude-code--do-send-command' if available, otherwise falls back to
35-
`claude-code--term-send-string'."
36-
(cond
37-
;; Try the newer claude-code--do-send-command if available (returns selected-buffer)
38-
((and (fboundp 'claude-code--do-send-command)
39-
(boundp 'claude-code-terminal-backend))
40-
(claude-code--do-send-command cmd))
41-
;; Fall back to older claude-code--term-send-string
42-
((and (fboundp 'claude-code--term-send-string)
43-
(boundp 'claude-code-terminal-backend))
44-
(claude-code--term-send-string claude-code-terminal-backend
45-
(concat cmd "\n")))
46-
(t
47-
(error "claude-code backend functions not available"))))
48-
4930
;;;###autoload
5031
(defun ai-code-claude-code-send-command (cmd)
5132
"Send CMD to claude-code programmatically or interactively.
@@ -54,7 +35,7 @@ which no longer accepts a command parameter.
5435
When called interactively, prompts for the command.
5536
When called from Lisp code, sends CMD directly without prompting."
5637
(interactive "sClaude command: ")
57-
(ai-code--claude-code-send-command-impl cmd))
38+
(claude-code--do-send-command cmd))
5839

5940
;;;###autoload
6041
(defcustom ai-code-backends

ai-code-codex-cli.el

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
(declare-function claude-code--start "claude-code" (arg extra-switches &optional force-prompt force-switch-to-buffer))
1414
(declare-function claude-code--term-send-string "claude-code" (backend string))
15-
(declare-function ai-code--claude-code-send-command-impl "ai-code-backends" (cmd))
1615
(defvar claude-code-terminal-backend)
1716

1817

@@ -45,7 +44,7 @@
4544
When called interactively, prompts for the command.
4645
When called from Lisp code, sends LINE directly without prompting."
4746
(interactive "sCodex> ")
48-
(ai-code--claude-code-send-command-impl line))
47+
(claude-code--do-send-command line))
4948

5049
;;;###autoload
5150
(defun codex-cli-resume (&optional arg)

ai-code-github-copilot-cli.el

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
(declare-function claude-code-switch-to-buffer "claude-code" (&optional arg))
1919
(declare-function claude-code--start "claude-code" (arg extra-switches &optional force-prompt force-switch-to-buffer))
2020
(declare-function claude-code--term-send-string "claude-code" (backend string))
21-
(declare-function ai-code--claude-code-send-command-impl "ai-code-backends" (cmd))
2221

2322

2423
(defgroup ai-code-github-copilot-cli nil
@@ -50,7 +49,7 @@
5049
When called interactively, prompts for the command.
5150
When called from Lisp code, sends LINE directly without prompting."
5251
(interactive "sCopilot> ")
53-
(ai-code--claude-code-send-command-impl line))
52+
(claude-code--do-send-command line))
5453

5554
;;;###autoload
5655
(defun github-copilot-cli-resume (&optional arg)

0 commit comments

Comments
 (0)