Function: claude-code-ide-insert-newline

claude-code-ide-insert-newline is an interactive and natively compiled function defined in claude-code-ide.el.

Signature

(claude-code-ide-insert-newline)

Documentation

Send newline (backslash + return) to a Claude Code terminal.

This simulates typing backslash followed by Enter, which Claude Code interprets as a newline. Inside a Claude terminal buffer it always targets that instance.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/yjvbhwl7p6zrbw9xlnni7y4hra8sa3pl-emacs-packages-deps/share/emacs/site-lisp/claude-code-ide.el
;;;###autoload
(defun claude-code-ide-insert-newline ()
  "Send newline (backslash + return) to a Claude Code terminal.
This simulates typing backslash followed by Enter, which Claude Code
interprets as a newline.  Inside a Claude terminal buffer it always
targets that instance."
  (interactive)
  (let ((session (claude-code-ide--resolve-session 'auto "Send newline to Claude instance: ")))
    (if-let* ((buffer (and session (claude-code-ide-mcp-session-buffer session))))
        (with-current-buffer buffer
          (claude-code-ide--terminal-send-string "\\")
          ;; Small delay to ensure prompt text is processed before sending return
          (sit-for 0.1)
          (claude-code-ide--terminal-send-return))
      (user-error "No Claude Code session for this project"))))