Function: claude-code-ide--sync-terminal-dimensions

claude-code-ide--sync-terminal-dimensions is a natively compiled function defined in claude-code-ide.el.

Signature

(claude-code-ide--sync-terminal-dimensions BUFFER WINDOW)

Documentation

Sync terminal dimensions in BUFFER to match WINDOW size.

This ensures the terminal process has the correct dimensions after the buffer has been displayed in its final window, which may differ from the window where it was initially created.

Source Code

;; Defined in /nix/store/yjvbhwl7p6zrbw9xlnni7y4hra8sa3pl-emacs-packages-deps/share/emacs/site-lisp/claude-code-ide.el
(defun claude-code-ide--sync-terminal-dimensions (buffer window)
  "Sync terminal dimensions in BUFFER to match WINDOW size.
This ensures the terminal process has the correct dimensions after
the buffer has been displayed in its final window, which may differ
from the window where it was initially created."
  (when (and buffer window (buffer-live-p buffer) (window-live-p window))
    (with-current-buffer buffer
      (when-let* ((proc (get-buffer-process buffer)))
        (let ((height (window-body-height window))
              (width (window-body-width window)))
          (if (eq claude-code-ide-terminal-backend 'ghostel)
              (progn
                (when (fboundp 'ghostel--window-adjust-process-window-size)
                  (ghostel--window-adjust-process-window-size proc (list window)))
                (set-process-window-size proc height width))
            (set-process-window-size proc height width)))))))