Function: claude-code-ide--setup-terminal-keybindings

claude-code-ide--setup-terminal-keybindings is a natively compiled function defined in claude-code-ide.el.

Signature

(claude-code-ide--setup-terminal-keybindings)

Documentation

Set up keybindings for the Claude Code terminal buffer.

This function binds:
- M-RET (Alt-Return) to insert a newline
- C-<escape> to send escape
- C-c C-x to drop the file or selection shown in the prompt

Source Code

;; Defined in /nix/store/yjvbhwl7p6zrbw9xlnni7y4hra8sa3pl-emacs-packages-deps/share/emacs/site-lisp/claude-code-ide.el
(defun claude-code-ide--setup-terminal-keybindings ()
  "Set up keybindings for the Claude Code terminal buffer.
This function binds:
- M-RET (Alt-Return) to insert a newline
- C-<escape> to send escape
- C-c C-x to drop the file or selection shown in the prompt"
  (cond
   ((eq claude-code-ide-terminal-backend 'vterm)
    ;; For vterm, we set up local keybindings in vterm-mode-map
    (local-set-key (kbd "S-<return>") #'claude-code-ide-insert-newline)
    (local-set-key (kbd "C-<escape>") #'claude-code-ide-send-escape)
    (local-set-key (kbd "C-c C-x") #'claude-code-ide-clear-selection))
   ((eq claude-code-ide-terminal-backend 'eat)
    ;; For eat, we need to modify the semi-char mode map which is the default
    ;; We use local-set-key to make it buffer-local
    (local-set-key (kbd "S-<return>") #'claude-code-ide-insert-newline)
    (local-set-key (kbd "C-<escape>") #'claude-code-ide-send-escape)
    (local-set-key (kbd "C-c C-x") #'claude-code-ide-clear-selection))
   ((eq claude-code-ide-terminal-backend 'ghostel)
    (local-set-key (kbd "S-<return>") #'claude-code-ide-insert-newline)
    (local-set-key (kbd "C-<escape>") #'claude-code-ide-send-escape)
    (local-set-key (kbd "C-c C-x") #'claude-code-ide-clear-selection))
   (t
    (error "Unknown terminal backend: %s" claude-code-ide-terminal-backend))))