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.
5435When called interactively, prompts for the command.
5536When 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
0 commit comments