Function: tramp-wslc-completion-function

tramp-wslc-completion-function is an autoloaded and byte-compiled function defined in tramp-container.el.gz.

Signature

(tramp-wslc-completion-function METHOD)

Documentation

List running WSL containers available for connection.

This function is used by tramp-set-completion-function, please see its function help for a description of the format.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-container.el.gz
;;;###tramp-autoload
(defun tramp-wslc-completion-function (method)
  "List running WSL containers available for connection.

This function is used by `tramp-set-completion-function', please
see its function help for a description of the format."
  (tramp-skeleton-completion-function method
    (when-let* ((raw-list
		 (shell-command-to-string (concat program " ps --format json")))
		(lines (string-lines raw-list 'omit))
		(names
		 (seq-keep
		  (lambda (line)
		    (or (gethash "Names" (json-parse-string line))
			(gethash "ID" (json-parse-string line))))
		  lines)))
      (mapcar (lambda (name) (list nil name)) names))))