Function: ghostel--cleanup-temp-paths

ghostel--cleanup-temp-paths is a natively compiled function defined in ghostel-shell.el.

Signature

(ghostel--cleanup-temp-paths FILES DIRS)

Documentation

Delete temporary FILES and DIRS created for remote shell integration.

Directories are removed recursively so any contents written into them, such as a per-session .zshenv, are cleaned up as well. Binding non-essential keeps TRAMP from opening a new connection (and possibly prompting for a password) just to delete temp files; when the remote connection is already gone the paths are simply left behind.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel-shell.el
(defun ghostel--cleanup-temp-paths (files dirs)
  "Delete temporary FILES and DIRS created for remote shell integration.
Directories are removed recursively so any contents written into them,
such as a per-session `.zshenv', are cleaned up as well.
Binding `non-essential' keeps TRAMP from opening a new connection (and
possibly prompting for a password) just to delete temp files; when the
remote connection is already gone the paths are simply left behind."
  (let ((non-essential t))
    (dolist (f files)
      (ignore-errors (delete-file f)))
    (dolist (d dirs)
      (ignore-errors (delete-directory d t)))))