Function: claude-code-ide--instance-buffer-name
claude-code-ide--instance-buffer-name is a natively compiled function
defined in claude-code-ide.el.
Signature
(claude-code-ide--instance-buffer-name DIRECTORY INSTANCE-NAME)
Documentation
Compute the terminal buffer name for INSTANCE-NAME in DIRECTORY.
claude-code-ide-buffer-name-function is called with both arguments
when it accepts two; the documented single-argument form keeps working
and gets INSTANCE-NAME spliced into (or appended to) its result. A nil
INSTANCE-NAME always yields the plain single-instance name.
Source Code
;; Defined in /nix/store/yjvbhwl7p6zrbw9xlnni7y4hra8sa3pl-emacs-packages-deps/share/emacs/site-lisp/claude-code-ide.el
(defun claude-code-ide--instance-buffer-name (directory instance-name)
"Compute the terminal buffer name for INSTANCE-NAME in DIRECTORY.
`claude-code-ide-buffer-name-function' is called with both arguments
when it accepts two; the documented single-argument form keeps working
and gets INSTANCE-NAME spliced into (or appended to) its result. A nil
INSTANCE-NAME always yields the plain single-instance name."
(let* ((fn claude-code-ide-buffer-name-function)
(max-arity (cdr (func-arity fn))))
(if (or (eq max-arity 'many)
(and (numberp max-arity) (>= max-arity 2)))
(funcall fn directory instance-name)
(let ((base (funcall fn directory)))
(cond
((null instance-name) base)
((string-suffix-p "]*" base)
(concat (substring base 0 -2) ":" instance-name "]*"))
(t (format "%s<%s>" base instance-name)))))))