Function: claude-code-ide--strip-new-tab-claude-windows

claude-code-ide--strip-new-tab-claude-windows is a natively compiled function defined in claude-code-ide.el.

Signature

(claude-code-ide--strip-new-tab-claude-windows &rest _)

Documentation

Remove cloned Claude side windows from a freshly created tab.

With tab-bar-new-tab-choice t a new tab clones the previous tab's layout, duplicating instance windows across tabs; each duplicate then toggles independently, which reads as broken toggling. New tabs start Claude-free instead — summon instances there explicitly.

Source Code

;; Defined in /nix/store/yjvbhwl7p6zrbw9xlnni7y4hra8sa3pl-emacs-packages-deps/share/emacs/site-lisp/claude-code-ide.el
(defun claude-code-ide--strip-new-tab-claude-windows (&rest _)
  "Remove cloned Claude side windows from a freshly created tab.
With `tab-bar-new-tab-choice' t a new tab clones the previous tab's
layout, duplicating instance windows across tabs; each duplicate then
toggles independently, which reads as broken toggling.  New tabs start
Claude-free instead — summon instances there explicitly."
  (dolist (window (window-list))
    (when (and (window-live-p window)
               (claude-code-ide--buffer-session (window-buffer window)))
      (unless (ignore-errors (delete-window window) t)
        ;; The sole window of the tab cannot be deleted — show another
        ;; buffer in it instead
        (when (window-live-p window)
          (switch-to-prev-buffer window 'bury)
          (when (claude-code-ide--buffer-session (window-buffer window))
            (set-window-buffer window (get-buffer-create "*scratch*"))))))))